Foros de discusión

Java heap space

dong chen, modificado hace 10 años.

Java heap space

New Member Mensajes: 7 Fecha de incorporación: 10/05/13 Mensajes recientes
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, modificado hace 10 años.

RE: Java heap space

Expert Mensajes: 459 Fecha de incorporación: 13/09/07 Mensajes recientes
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, modificado hace 10 años.

RE: Java heap space

New Member Mensajes: 7 Fecha de incorporación: 10/05/13 Mensajes recientes
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.