Foren

Java heap space

dong chen, geändert vor 10 Jahren.

Java heap space

New Member Beiträge: 7 Beitrittsdatum: 10.05.13 Neueste Beiträge
When I run my program ,it Will appear Java heap space overflow.
But I changed it Memory size,it can't work. What can I do to solve this problem? Please give advice or comments
thumbnail
Artur Linhart, geändert vor 10 Jahren.

RE: Java heap space

Expert Beiträge: 459 Beitrittsdatum: 13.09.07 Neueste Beiträge
Ok, if the increase of memory does not help, then my guess will be, you will have some error in the program. The error causes the creation of lot of objects without releasing them. You still remember some references to created objects so they cannot be released by the garbage collector. Try to debug the program and see what happens, try to see how change the values of

Runtime.getRuntime().maxMemory();
Runtime.getRuntime().totalMemory();
Runtime.getRuntime().freeMemory();

on specific lines...
dong chen, geändert vor 10 Jahren.

RE: Java heap space

New Member Beiträge: 7 Beitrittsdatum: 10.05.13 Neueste Beiträge
Good !Your judgment is right.
I found that there is a cycle of error on the page, is it cause memory cannot be released by the garbage collector.
Thank you very much.