#10 The profiler deadlocks

1.0-beta1
open
nobody
AGENT (8)
5
2008-01-09
2008-01-09
No

The profiler seems to deadlock a lot on my NetBeans Platform -based application (which has a moderate amount of threads).

From what I've noticed in your code, there's a globalLock which probably is too rigid for multithreaded apps.

Found one Java-level deadlock:
[INFO] =============================
[INFO] "main":
[INFO] waiting to lock monitor 0x018033d8 (object 0x06b10868, a java.lang.Object),
[INFO] which is held by "PROFILER4J_REMOTE_AGENT"
[INFO] "PROFILER4J_REMOTE_AGENT":
[INFO] waiting to lock monitor 0x01803390 (object 0x06a7ce48, a sun.misc.Launcher$AppClassLoader),
[INFO] which is held by "main"
[INFO]
[INFO] Java stack information for the threads listed above:
[INFO] ===================================================
[INFO] "main":
[INFO] at net.sf.profiler4j.agent.Transformer.transform(Transformer.java:56)
[INFO] - waiting to lock <0x06b10868> (a java.lang.Object)
[INFO] at sun.instrument.TransformerManager.transform(TransformerManager.java:122)
[INFO] at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:155)
[INFO] at java.lang.ClassLoader.defineClass2(Native Method)
[INFO] at java.lang.ClassLoader.defineClass(ClassLoader.java:719)
[INFO] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:160)
[INFO] at java.net.URLClassLoader.defineClass(URLClassLoader.java:254)
[INFO] at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
[INFO] at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
[INFO] at java.security.AccessController.doPrivileged(Native Method)
[INFO] at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
[INFO] - locked <0x06a7ce48> (a sun.misc.Launcher$AppClassLoader)
[INFO] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
[INFO] - locked <0x06a7ce48> (a sun.misc.Launcher$AppClassLoader)
[INFO] at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
[INFO] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
[INFO] - locked <0x06a7ce48> (a sun.misc.Launcher$AppClassLoader)
[INFO] at org.netbeans.ModuleManager.<init>(ModuleManager.java:122)
[INFO] at org.netbeans.core.startup.ModuleSystem.<init>(ModuleSystem.java:60)
[INFO] at org.netbeans.core.startup.Main.getModuleSystem(Main.java:199)
[INFO] - locked <0x0aa6e640> (a java.lang.Class)
[INFO] at org.netbeans.core.startup.Main.start(Main.java:383)
[INFO] at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:96)
[INFO] at java.lang.Thread.run(Thread.java:613)

[INFO] "PROFILER4J_REMOTE_AGENT":
[INFO] at sun.instrument.InstrumentationImpl.redefineClasses0(Native Method)
[INFO] at sun.instrument.InstrumentationImpl.redefineClasses(InstrumentationImpl.java:79)
[INFO] at net.sf.profiler4j.agent.Agent.reloadClasses(Agent.java:178)
[INFO] - locked <0x06b10868> (a java.lang.Object)
[INFO] at net.sf.profiler4j.agent.Server.serveClient(Server.java:133)
[INFO] at net.sf.profiler4j.agent.Server.run(Server.java:73)
[INFO]
[INFO] Found 1 deadlock.

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks