留言板

Java heap space

dong chen,修改在10 年前。

Java heap space

New Member 帖子: 7 加入日期: 13-5-10 最近的帖子
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,修改在10 年前。

RE: Java heap space

Expert 帖子: 459 加入日期: 07-9-13 最近的帖子
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,修改在10 年前。

RE: Java heap space

New Member 帖子: 7 加入日期: 13-5-10 最近的帖子
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.