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.
There is a suspicion on a memory leak in JSP/servlet functionality. There is a report on nbusers about increasing memory consumption with the latest q-build. The user did not see the suspicios increase with 5.0 beta, so this is most probably a problem introduced after beta. I will let the user add comments to this issue.
Here is a link to the mail on nbusers: http://www.netbeans.org/servlets/ReadMsg?list=nbusers&msgNo=59620
Would you be able to provide more info here?
Please, go and ask the user. Or try to reproduce it. I asked Petr Jiricka to take care of this. Performance team is currently working on other high priority issues and cannot investigate it.
An email reply from the reporter: --------- I didn't have any time lately on work to perform IDE testing -- simply returned to the Beta after writing that message, as the qbuild was too much of a worry for me to use in production - besides the memory issue, it also threw all kinds of exceptions on me, esp. the embarrassing one with invalid text offsets range, when opening a JSP in the editor. So I confirm the issue doesn't appear on the Beta. Yes, of course, I use refactoring all the time, as well as the new CVS, edit all kinds of content (XML, XSL, SQL, JSP tags and TLDs, etc). What I don't do in this project at all is Swing development. Well, and I *think* I also don't use any additional modules besides what comes built-in. The only application server I have in the IDE is the built-in Tomcat. -------- User confirms that he did use a lot of netbeans features including refactoring so I do not see a reason to have this issue assigned to web module. Moreover I think that filling issues like "suspicious memory leak" is not a good idea while you do not have anything concrete. I am reassigning the issue to Tonda so if you find a concrete problem related to our modules reassign back with some steps to reproduce. Without this I cannot do much.
Closing as WONTFIX. At the moment perfomance team does not have cycles to audit and proactively look where memory leaks could be. Let's hope someone will report the problem with more details to find where the problem is.
Unfortunately, I didn't have time to investigate this issue in depth, but I confirm that I am able to reproduce it with the latest QBuild (31/10). Windows task manager currently (after 2-3 hours of active usage) shows the usage of 450 Mb RAM, while NetBeans memory indicator shows 65/124MB. This never happened with NB 4.1 or NB 5.0 Beta - the typical amount of memory the IDE used after fairly long usage session was about 250 MB (as shown in Task Manager). I have 1GB RAM total. I didn't change any NetBeans' start-up parameters. To give you a clue about the size of the project, we currently have 101 classes, 54 jsps, 12 XML custom tags (*.tag). Additionally, I can say that during today's usage session I only edited a couple of JSPs, performed builds of the application and ran it from the browser. BTW, I forgot to mention the JDK version: 5.0.
I found an extensive memory leak in JSP editor. Opening/closing of a JSP page leaves a lots of hard referenced objects. I will attach an output from jprofiler and try to fix this issue ASAP. Thanks Kiril for finding this!
Created attachment 26591 [details] The JProfiler output showing what is not GCed after open/close of one JSP file
I have filled a separate issue #68023 against core/palette regarding memory leak caused by component palette.
I have filled another issue against editor module related to this: Issue #68030 - BaseDocument holding syntax instancies memory leak. This causes about 1,5kB memory leak per JSP file opening/closing.
fixed two sources of the leaking memory: 1) JspUpToDateStatusProvider used to hold a strong reference to JspColoringData which caused that the document and a lot of connected object weren't GCed. Now a WeakListener is used. 2) JspParserAccess held a strong reference to WebModule instance and was registered as a listener of ClassPath which was referenced from the WM. Solution the same as in the first case. There is remaining "minor" problem with the leaking palette and probably the syntaxes, but both of them doesn't cause big leaks and must be fixed in another modules => downgrading this issue to P3. Checking in web/jspsyntax/src/org/netbeans/modules/web/core/syntax/JspUpToDateStatusProvider.java; /cvs/web/jspsyntax/src/org/netbeans/modules/web/core/syntax/JspUpToDateStatusProvider.java,v <-- JspUpToDateStatusProvider.java new revision: 1.4; previous revision: 1.3 done Checking in web/core/src/org/netbeans/modules/web/core/jsploader/JspParserAccess.java; /cvs/web/core/src/org/netbeans/modules/web/core/jsploader/JspParserAccess.java,v <-- JspParserAccess.java new revision: 1.11; previous revision: 1.10 done
Since I have closed the issue #68030 as worksforme and the issue #68023 must be fixed in core/palette module I am closing this issue as fixed.
Marek, what's exactly the problem with listener attached to coloring data? I thought these should disappear when editor is closed. At least the test I have written support this and JspUpToDateStatusProvider is GC w/ weakly attached listener as well as with normally attached. Of course I can miss something (taglib referenced from JSP, node in explorer).
Created attachment 26633 [details] testcase
Great work, Marek! I didn't even dream someone would actually fix this in response to bug report as vague as that one. Looking forward to try the next qbuild :) Nothing to say - applause to the NetBeans team. This is why I love this IDE :)
Radime, unfortunatelly I cannot get the reference graph showing the problem with UpToDateStatusProvider anymore!?! I am not sure why (maybe a cause of another fix) but I have verified that without the fix there is a huge number of objects related to the NbEditorDocument instance leaking. Putting the fix back the leak is gone. I have verified this twice. If you have problems with reproducing it came to me and we can try to find it on my machine using the JProfiler. A note to Kirill: Please note that during profiling this issue I have filled an Issue #68039 (Memory leak when completion initialized) which has to be resolved in editor module. Whithout having this fixed there will be still some objects leaking, however AFAIK not as big as this one. Please let me know whether the fix helped. Thanks.
I've tried the daily from 07/11, and it seemed much better, but still ate more and more memory. I've restarted the IDE, when it was at 450Mb, which took 4 to 5 hours of active usage.
AFAIK the fix of Issue #68039 is not in 20051107 daily build. Try a newer one please.
I've tested the 8/11 build, and the leak was still apparent, leading to 450+ memory consumption during a couple of hours. I was mostly editing jsp, tag, html, js and web.xml files, but also some java code.
OK. That is bad, however I belive the source of the leak should not be the JSP editor. You wrote that you edited some XML files so I tried to measure them and found another "nice" memory leak. The leak is an ancient one, but recently more objects are held because of it. For more info read Issue #68452 (XML DataObject -> NbEditorDocument memory leak). I am going to fix it somehow today so it could also help. But I am not so much optimistic ... sometimes it seems to me that there is leaking almost everything... :-). I am doing my best to get rid at least of the biggest ones. But please ... don't praize the day before evening :-)
Hehe. However, you did fix this bug and #68039, so I still feel you deserved the praise :) Anyway, I'm not much worried, since I can always get back to the beta, and for sure the problem I'm seeing will eventually get fixed for the final release.
Marek, I've been using the daily 200511131900 all day long and the reported issue didn't show up. After 4 or 5 hours of active usage, the IDE consumed ~200MB, as shown in the Windows Task Manager. This build is in many other ways better than all the prvious builds I've tried since beta. Could it be that the fix for this and other leaks was only included in Nov 13's release? Is there a changelog between dailies that includes this info? Thanks again.