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.
Split off from Issue 85179... Here's a recipe for reproducing the problem, using only a simple Web Project in NetBeans 5.0 with jdk 1.5.0_06: 1. Create a new web project 2. Windows...Runtime...Servers...Bundled Tomcat...Properties...Platform...VM Options: -Dcom.sun.management.jmxremote 3. Start the internal tomcat server 4. $JAVA_HOME/bin/jconsole.exe 5. In JConsole, connect to the catalina VM (org.apache.cataline.startup.Bootstrap start) 6. In the Memory tab, select "Memory Pool 'Perm Gen'" from the "Chart" combo box 7. Deploy the webapp in NB 8. Go to Step 7 Each time you deploy, your PermGen space usage will monotonically increase. The effect is more pronounced if you add libraries to your webapp (like JSF) I'm not sure what the contract between NB and Tomcat is with respect to re-deploying an already-deployed app. Either: 1. NB has to tell tomcat that the overwritten app is no longer needed, so its resources can be undeployed. 2. Tomcat has to be smart enough to know that this new app being deployed is a replacement for an already-deployed app, and it must release the appropriate ClassLoader/classes/etc. 3. I'm off my rocker and it's something else altogether. If it's (1), then I guess this is a valid bug report. If it's (2), then I guess tomcat gets a bug report. If it's (3) I'll go crawl away :)
NetBeans is using the Tomcat Manger web application for deploying/undeploying web applications to Tomcat and according to what Gregg noted: "Using Tomcat's Manager user interface (instead of NetBeans) I repeatedly redployed (the button is labeled "Reload" in the Tomcat Manager UI) a simple web application and I saw perm gen increase in size (by about 8K) each time." the problem is in Tomcat itself -> closing as INVALID.
Rich, it really looks that this is a problem in Tomcat. It would be good to verify that this is dup of some known Tomcat bug like http://issues.apache.org/bugzilla/show_bug.cgi?id=33711. It can be also a different problem if this is related to JMX RI. BTW: did you really reached OOME? Perm gen will only be collected when full GC runs.
I filed http://issues.apache.org/bugzilla/show_bug.cgi?id=40679 Radim: Yes, I actually see OutOfMemoryErrors, because the increase is much higher than 8k if you have more classes in the webapp (say, if you add some libraries like JSF, struts, etc).