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 268777 - ProjectClassLoader is never garbage collected. IDE runs out out memory when using the GUI builder.
Summary: ProjectClassLoader is never garbage collected. IDE runs out out memory when u...
Status: NEW
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 8.2
Hardware: All Other
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-01 19:44 UTC by schulte2004
Modified: 2016-11-01 19:45 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Example project demonstrating the issue. (18.68 KB, application/x-zip-compressed)
2016-11-01 19:44 UTC, schulte2004
Details
Example project demonstrating the issue with Maven. (5.20 KB, application/x-zip-compressed)
2016-11-01 19:45 UTC, schulte2004
Details

Note You need to log in before you can comment on or make changes to this bug.
Description schulte2004 2016-11-01 19:44:57 UTC
Created attachment 162721 [details]
Example project demonstrating the issue.

Please see the two example projects attached. Steps to reproduce:

cmd>unzip ProjectClassLoaderTestAnt.zip
Archive:  ProjectClassLoaderTestAnt.zip
   creating: ProjectClassLoaderTestAnt/
   creating: ProjectClassLoaderTestAnt/nbproject/
  inflating: ProjectClassLoaderTestAnt/nbproject/project.xml  
   creating: ProjectClassLoaderTestAnt/nbproject/private/
  inflating: ProjectClassLoaderTestAnt/nbproject/private/private.properties  
  inflating: ProjectClassLoaderTestAnt/nbproject/private/private.xml  
  inflating: ProjectClassLoaderTestAnt/nbproject/project.properties  
  inflating: ProjectClassLoaderTestAnt/nbproject/genfiles.properties  
  inflating: ProjectClassLoaderTestAnt/nbproject/build-impl.xml  
  inflating: ProjectClassLoaderTestAnt/build.xml  
   creating: ProjectClassLoaderTestAnt/src/
  inflating: ProjectClassLoaderTestAnt/src/ProjectComponent.java  
  inflating: ProjectClassLoaderTestAnt/src/ProjectComponent.form  
  inflating: ProjectClassLoaderTestAnt/src/ProjectFrame.java  
  inflating: ProjectClassLoaderTestAnt/src/ProjectFrame.form  
  inflating: ProjectClassLoaderTestAnt/manifest.mf  

cmd>cd ProjectClassLoaderTestAnt
cmd>ant compile
....
BUILD SUCCESSFUL
Total time: 4 seconds

Start the Netbeans IDE and open the project.
Connect with visualvm.
Take a memory snapshot and verify no "ProjectClassLoader" objects exist.
Open "ProjectFrame" with the GUI builder.
Close the form without doing anything else.
Take a memory snapshot and verify one "ProjectClassLoader" object exists.
Open "ProjectFrame" with the GUI builder again.
Close the form without doing anything else.
Take a memory snapshot and verify two "ProjectClassLoader" objects exist.
Repeat.

Whenever the form is opened, a new "ProjectClassLoader" object is created and never garbage collected. After working with multiple forms for some time, the IDE runs out of memory.

Same for Maven based projects. See "ProjectClassLoaderTestMaven.zip".

The cause for this seems to be the "ProjectFrame" form using  "ProjectComponent" from the project. That's why the form can only be opened when the project has been compiled.

Expected behaviour is the "ProjectClassLoader" object of the form getting garbage collected when the form has been closed.
Comment 1 schulte2004 2016-11-01 19:45:42 UTC
Created attachment 162722 [details]
Example project demonstrating the issue with Maven.