开发者

Outofmemory error in java

hi we are getting out of memory exce开发者_如何学Goption for one of our process which is running in unix environmnet . how to identify the bug (we observed that there is very little chance of memory leaks in our java process). so whatelse we need analyse to find the rootcauase


I would suggest using a profiler like YourKit (homepage) so that you can easily find what is allocating so much memory.

In any case you should check which settings are specified for your JVM to understand if you need more heap memory for your program. You can set it by specifying -X params:

java -Xmx2g -Xms512m

would start JVM with 2Gb of maximum heap and a starting size of 512Mb


If there are no memory leaks then the application needs more memory. Are you getting out of heap memory, or perm memory or native memory? For heap memory and perm memory you can increase allocation using -Xmx.or -XX:PermSize arguments respectively.

But first try using a profiler to verify that your application is really not leaking any memory.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜