I faced a similar situation. My program was supposed to run a simulation for 10,000 samples. I tried -Xmx1024m: it crashed anyway.
Then I realized, given that my program is too much to put up with the console; my console memory can go OOB.
Easy solution => right-click console> settings> output of the final console Limit Check> Enter the buffer size (characters) [default: 80000].
I did not test it for a single run analysis, but when there were 10,000 samples in the final run, it started to fail, passing 500 tests.
Today was a day: I thought three times that how Java programming helps me skip all the freed memory and curse C for the same thing. And so, I spent the last 2 1/2 hours to find out how to get GC, how to remove the variable (by the way, not one was needed).
Have a nice day!
source share