Sahil, you have not said how much memory is on the box (or VM or container) that is running this jvm/app. Is it around 5gb? It seems simply that you're exceeding that, thus the Linux OOM killer is killing the process/jvm (as "the largest user of memory").
Perhaps you already "knew" that (but do let us know the OS memory size, in case it may help us). And perhaps you're just wondering "I set my max heap well within that, so how is it exceeding that?"
Note that your report shows you using 1gb of metaspace. You could certainly set a maxmetaspace for the jvm...but that would merely cause the jvm itself to crash with its own oom:metaspace error.
So assuming you can't raise the total os memory (or you merely prefer not to, or "just want to understand where the memory use is"), it seems the focus should turn to why the metaspace is growing so much. Usually that's about the tracking of meta info about class loading, and it's being filled due to excessive class loading. Sometimes there may be configurable aspects of your app (in your case, yarn) that might influence that, where you could get the app to lower the number of classes it's loading. I know nothing of yarn to suggest that.
Maybe someone else will, or perhaps the ycrash team will see something else to suggest for you, or to ask if you. I'm just a fellow user and server troubleshooter offering my thoughts if they may help.

Edit your Comment