views:

124

answers:

2

hi we are getting out of memory exception 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

+1  A: 

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

Jack
A: 

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.

saugata