I am getting the following error while executing the program.
And this is not always happening. The code contains some complex calculations with a large volume of data
The crash is in the jvm JIT compiler. You could try turning off the compiler to see if it helps to diagnose the issue. Use the -Xint option.