Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Process did not die after OutOfMemoryException

I was testing an application, where my application threw OutOfMemory exception, but the process is still alive, as I can see from ProcessExplorer. I thought it was just alive and not doing anything after OOM, but after some time I still see some aplication activity. I am a bit surprised. Any reason why this can happen?

java.lang.OutOfMemoryError: Java heap space
Dumping heap to java_pid8920.hprof ...
Heap dump file created [2826469039 bytes in 59.888 secs]
Exception in thread "ActiveMQ Transport: tcp://localhost/127.0.0.1:61000@53335"
java.lang.OutOfMemoryError: Java heap space

JVM options I used are:

-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+PrintGCDetails -verbose:gc -Xloggc:C:/temp/GCVerbose.log

It is a 64-bit Java 1.7.

EDIT:::

I thought the application is still doing something as I saw a few more application related log messages after the OOM exception. But after a few minutes, I see final exception stack like below and the application activity stopped. But the process is still alive!

Exception in thread "pool-3-thread-1" java.lang.OutOfMemoryError: Java heap space
Exception in thread "ActiveMQ Session Task-13" java.lang.OutOfMemoryError: Java heap space
Feb 17, 2013 4:54:44 PM sun.rmi.transport.tcp.TCPTransport$AcceptLoop executeAcceptLoop
WARNING: RMI TCP Accept-0: accept loop for ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=53490] throws
java.lang.OutOfMemoryError: Java heap space
    at java.net.NetworkInterface.getAll(Native Method)
    at java.net.NetworkInterface.getNetworkInterfaces(NetworkInterface.java:326)
    at sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:86)
    at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:387)
    at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:359)
    at java.lang.Thread.run(Thread.java:722)

Feb 17, 2013 4:57:34 PM ServerCommunicatorAdmin reqIncoming
WARNING: The server has decided to close this client connection.
Exception in thread "ActiveMQ InactivityMonitor Worker" java.lang.OutOfMemoryError: Java heap space
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
like image 293
endless Avatar asked Mar 20 '26 17:03

endless


1 Answers

Try kill -3 <process-pid> to print Java thread dumps and see where is the app hanging.

like image 55
Aleš Avatar answered Mar 23 '26 07:03

Aleš



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!