IBM WebSphere OutOfMemoryException

Often I found an OutOfMemoryException on an IBM Websphere Application Server. I think this exception is due to the fact that my application is retrieving huge data from a database. Thus, I limit the entire query by not returning data of more than 1000 records and installing the JVM from WAS follow

+ Verbose garbage collection + Maximum Heap size = 1024 (RAM on my server is 16 GB and now I already change to 8192) + Debug arguments = -Djava.compiler=NONE -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777 + Generic JVM arguments = -Dsun.rmi.dgc.server.gcInterval=60000 -Dsun.rmi.dgc.client.gcInterval=60000 -Xdisableexplicitgc -Dws.log=E:\WebApp\log -Dws.log.level=debug (ws.log and ws.log.level are my properties) 

And I found the heapdump , javacore and snap files in the profiles folder. I think they can tell me about the cause of the problem, but I don’t know, t can read / use heapdump, javacore and snap files.

Please tell me how to prevent / eliminate / fix the OutOfMemoryException exception. Thanks

+4
source share
6 answers

The answer to this depends on the message associated with the OutOfMemoryException. You can also try -XX: MaxPermSize = ... and set it to something more, like 256 m.

Also, if you have a recursive function, this can cause a stack overflow.

If you can, send a message related to the exception. Stacktrace can also help.

+1
source

If you want to see heap dump files, IBM offers tools for analyzing them here .

+3
source

"Thanks for the memory" is a good article on JVM memory usage that could help in analyzing this problem ...

Thanks bwalliser for this link

+1
source

Try reproducing the problem locally so that you can use the JProfiler tool to debug it. Even if you cannot force OOM locally, you will most likely see an increase in memory in JProfiler. Then you take pictures and watch classes that are not going to garbage. This is not an exact science, but it is much simpler than viewing the IBM heapdump. However, if you needed to, the old way to learn heap heap was with HeapRoots. This may depend on the version you are in. I know that some versions of the IBM JDK have problems with compaction, so even if you have a lot of memory, you can get OOM because there is not a large enough fragment.

0
source

I assume you use hibernate / JPA as a continuity provider? Do you use second level cache? If so, did you consider evicting large result sets from the cache?

0
source

The question is difficult to answer if we do not know what OutOfMemoryError is; permgen and heapspace are two completely different animals.

I tried for many months on Per-gen in JBoss, although this type of problem was common to any application server that "reloaded" web applications on the fly. The saga is registered here .

Those dump heaps that you have ... might be that you can analyze them in the Eclipse MAT .

0
source

Source: https://habr.com/ru/post/1277565/


All Articles