简体   繁体   中英

Java memory heap error

错误消息截图

I didn't find anything for this error on the net, can anyone help? I have a stub class that is more than 30,000 lines of code, maybe it caused the problem?

i have a stub class that is more than 30 000 line code maybe it caused the problem ??

Yes, this could certainly be the root cause. In any case, it seems that Eclipse is running out of heap space. Try assigning more heap space to Eclipse. In your eclipse.ini , change

-Xmx512m

to a higher value, like

-Xmx1024m

See also http://wiki.eclipse.org/FAQ_How_do_I_increase_the_heap_size_available_to_Eclipse%3F for more information.

By the way you can increase size of java heap space based on your application need and I always recommend this to avoid using default JVM heap values. if your application is large and lots of object created you can change size of heap space by using JVM options -Xms and -Xmx. Xms denotes starting size of Heap while -Xmx denotes maximum size of Heap in Java. There is another parameter called -Xmn which denotes Size of new generation of Java Heap Space. Only thing is you can not change the size of Heap in Java dynamically, you can only provide Java Heap Size parameter while starting JVM.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM