This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 213676 - Memory leak in RemoteServices
Summary: Memory leak in RemoteServices
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 7.2
Hardware: All All
: P2 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-06 14:37 UTC by Martin Entlicher
Modified: 2012-06-07 06:00 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Entlicher 2012-06-06 14:37:28 UTC
Java debugger was run ten times on Anagrame Game sample project.
After last debugger session finished and several GC's were performed, heap dump was taken.
As can be seen from the attached heap dump, 10 instances of JPDADebuggerImpl are held in memory by RemoteServices.remoteServiceClasses static field.
Comment 1 Martin Entlicher 2012-06-06 14:40:03 UTC
Attachment creation failed, therefore I'm providing the path from the GC root below:

this     - value: org.netbeans.modules.debugger.jpda.JPDADebuggerImpl #4
 <- debugger     - class: org.netbeans.modules.debugger.jpda.breakpoints.LineBreakpointImpl, value: org.netbeans.modules.debugger.jpda.JPDADebuggerImpl #4
  <- value     - class: java.util.HashMap$Entry, value: org.netbeans.modules.debugger.jpda.breakpoints.LineBreakpointImpl #8
   <- [3]     - class: java.util.HashMap$Entry[], value: java.util.HashMap$Entry #202819
    <- table     - class: java.util.HashMap, value: java.util.HashMap$Entry[] #33959 (4 items)
     <- clientProperties     - class: com.sun.tools.jdi.EventRequestManagerImpl$BreakpointRequestImpl, value: java.util.HashMap #32180
      <- [0]     - class: java.lang.Object[], value: com.sun.tools.jdi.EventRequestManagerImpl$BreakpointRequestImpl #8
       <- elementData     - class: java.util.ArrayList, value: java.lang.Object[] #34678 (10 items)
        <- [2]     - class: java.util.List[], value: java.util.ArrayList #20007
         <- requestLists     - class: com.sun.tools.jdi.EventRequestManagerImpl, value: java.util.List[] #8 (101 items)
          <- eventRequestManager     - class: com.sun.tools.jdi.VirtualMachineImpl, value: com.sun.tools.jdi.EventRequestManagerImpl #8
           <- vm     - class: com.sun.tools.jdi.ClassObjectReferenceImpl, value: com.sun.tools.jdi.VirtualMachineImpl #4
            <- value     - class: java.util.WeakHashMap$Entry, value: com.sun.tools.jdi.ClassObjectReferenceImpl #5
             <- [7]     - class: java.util.WeakHashMap$Entry[], value: java.util.WeakHashMap$Entry #12733
              <- table     - class: java.util.WeakHashMap, value: java.util.WeakHashMap$Entry[] #948 (16 items)
               <- remoteServiceClasses     - class: org.netbeans.modules.debugger.jpda.visual.RemoteServices, value: java.util.WeakHashMap #955
Comment 2 Martin Entlicher 2012-06-06 15:13:42 UTC
Fixed by changeset:   223338:8aa42db73237
http://hg.netbeans.org/main/rev/8aa42db73237
Comment 3 Quality Engineering 2012-06-07 06:00:08 UTC
Integrated into 'main-golden', will be available in build *201206070001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/8aa42db73237
User: mentlicher@netbeans.org
Log: #213676: Release the debugger instance from remoteServiceClasses after debugger finishes.