掲示板

Java heap space

10年前 に dong chen によって更新されました。

Java heap space

New Member 投稿: 7 参加年月日: 13/05/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
10年前 に Artur Linhart によって更新されました。

RE: Java heap space

Expert 投稿: 459 参加年月日: 07/09/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...
10年前 に dong chen によって更新されました。

RE: Java heap space

New Member 投稿: 7 参加年月日: 13/05/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.