I've searched much on the topic. But no concrete solution/guide is present.
From the docs,
Some virtual machines may, under some circumstances, omit one or more stack frames from the stack trace. In the extreme case, a virtual machine that has no stack trace information concerning this throwable is permitted to return a zero-length array from this method.
Can someone shed light on what conditions this may/will happen?
I know it happens if the same stack trace is produced over and over again (There is no hard-and-fast-rule on the count, AFAIK- Correct me otherwise). But must not this be having a defined behaviour?
Also,As per this, passing -XX:-OmitStackTraceInFastThrow
will make sure my StackTrace
is not lost. Isn't it wise always to do that in Production machines?