留言板
Java heap space
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
But I changed it Memory size,it can't work. What can I do to solve this problem? Please give advice or comments
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...
Runtime.getRuntime().maxMemory();
Runtime.getRuntime().totalMemory();
Runtime.getRuntime().freeMemory();
on specific lines...