Eclipse heap space (out of memory error)

前端 未结 3 1903
盖世英雄少女心
盖世英雄少女心 2021-02-06 12:07

I am facing memory issue in eclipse. Initially I was getting this error: ‘Unhandled event loop exception java heap space’ and also sometimes ‘An out of memory error has occured’

3条回答
  •  孤城傲影
    2021-02-06 13:00

    I faced similar situation. My program had to run simulation for 10000 trials. I tried -Xmx1024m : still it crashed.

    Then I realized given my program had too much to put up on console; my console-display memory may be going OOB.

    Simple solution=> right-click console > preferences > Check Limit console output > Enter Buffer size(characters)[Default: 80000].

    I had unchecked it for analyzing single run, but when the final run had 10000 trials, it started to crash passed 500 trials.

    Today was the day: I thought three times, that how programming in Java helps me skip the whole job memory deallocation and cursed C for the same. And here I am, spent last 2 1/2 hours to find how to force GC, how to dellocate variable( By the way, none was required).

    Have a good day!

提交回复
热议问题