VisualVM connect to local TomEE very slow and can not take a heap dump
Asked Answered
M

1

7

I encountered a very strange problem with TomEE 1.5.1 and VisualVM 1.7.0_09 on MAC OSX mountain lion.

After TomEE loaded some webapp.Use VisualVM connect local TomEE process take long time, and after connected the gc button is disabled and I can not take a heap dump. the VisualVM' log show some error.

com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file: target process not responding or HotSpot VM not loaded
    at sun.tools.attach.BsdVirtualMachine.<init>(BsdVirtualMachine.java:90)
    at sun.tools.attach.BsdAttachProvider.attachVirtualMachine(BsdAttachProvider.java:63)
    at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:213)
    at com.sun.tools.visualvm.attach.AttachModelImpl.getVirtualMachine(AttachModelImpl.java:104)
Caused: java.io.IOException: Unable to open socket file: target process not responding or HotSpot VM not loaded

the .java_pid<pid> file not created in tmp folder.

But if I use VisualVM to connect TomEE after start it and before any webapps loaded, The .java_pid<pid> file will created, and VisualVM will connect to it immediately, and heap dump works.

Another workaround is modify catalina.sh to add tools.jar to the ClassPath and remove openejb javaagent, then connect after TomEE fully started works fine.

Can not reproduce on a ubuntu machine.

Middleaged answered 3/12, 2012 at 7:4 Comment(2)
are you connecting with JMS ? Try with JMS.Narayan
Try jconsole and see how that worksEngland
T
1

Probably jvm is running out of memory. I've seen it many times. Try:

  1. increasing memory limits.
  2. Connect VisualVM to jvm.
  3. Deploy your application.
  4. And run memory sampler, profiler or heap dump to diagnose the issue. You probably have memory leaks. Heap dump is the safest way to go if you have memory issues. You can also take heap dump using command line and analyze it in VisualVM later.

Also make sure your system is not running out of memory.

Techy answered 27/8, 2014 at 19:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.