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 123889 - memory leak when developing web application
Summary: memory leak when developing web application
Status: RESOLVED INVALID
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 9 (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker (vote)
Assignee: _ pcw
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-12 15:07 UTC by bernd_zedv
Modified: 2007-12-21 21:14 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 bernd_zedv 2007-12-12 15:07:31 UTC
Using NB 6.0 with GF V2 ur1 b09

To me it looks like there is a memory leak at NB and GF when a web application is run over and over again during
development cycles. 

Today I had to make cosmetically changes to one web project ( only .jsp and .css files where involved ). The WAR is part
of an EAR (where some ejbs and a number of entities are included). With the WAR three RichFaces jars and some apache
commons jars are deployed to GF.

Because I recognized memory consumption by both NB as well as GF up to a point where my notebook (2 GIG memory) becomes
nearly inoperable, I jotted down the memory figures from Windows TaskManager today.

After 5 times RUN Mainproject (the EAR) NB grew from 205 to 326 Megabytes in chunks of 16 to 24 MB and GF from about 190
to 279 Megabytes in chunks of 6 to 48 MB. If I would continue working with NB this way, it would end up at more than 500
MB for each of the two, as I have seen it when I was working with beta and rc versions of NB already.
Comment 1 bernd_zedv 2007-12-12 15:10:27 UTC
Directory deployment was enabled for GF!
Comment 2 Petr Hejl 2007-12-12 15:20:55 UTC
Not sure if this is memory leak or just greedy JVM. Did you met any OutOfMemoryError?
Comment 3 bernd_zedv 2007-12-17 12:09:07 UTC
No, this time I did not wait until I got Out-Of-Memory but I have got this
message when I was using one of the daily builds some weeks ago.

Please see my report to Issue #70052, where I have also posted a thread dump.
Comment 4 Nitya Doraisamy 2007-12-18 18:22:20 UTC
Is the same as Issue #70052 
Comment 5 _ pcw 2007-12-18 21:22:55 UTC
I did some simple tests and did not see evidence of a significant memory leak in this area.

Do GC's (clicking on the memory indicator in the IDE toolbar causes a GC) allow the memory increase to be reclaimed?

Do you see this leak in other projects or smaller projects?

If you restart the IDE with only this EAR & subprojects loaded, NO open editors, and merely run the EAR over and over,
followed by GC's, does it appear there is still a leak?

So far there is too little information to go on.
Comment 6 bernd_zedv 2007-12-21 15:50:12 UTC
Reduced test environment:
a) Windows XP - memory consumption monitored with Task Manager
b) Single page Java Server Faces WAR project - not Visual Web
   created with wizard for JSF 1.2 framework
c) One backing bean - instantiating a graph of about five DTO beans
d) Twenty JSF tags - labels, input, message
e) Using a clean remote registered GF V2 (running on localhos)
   with a no other applications installed

Repeated right-click RUN on the Web Project 50 times:
Memory consumption grew from 214 to 269 MB.
Continued right-click RUN on the Web Project 50 times:
Memory consumption grew from 269 to 345 MB

GF Memory consumption stabilized at 241 MB

Doing GCs had no impact on memory consumption displayed by Windows Task Manager

Comment 7 bernd_zedv 2007-12-21 16:09:48 UTC
Sorry but just after I shut down NetBeans the other Java process - belonging to GF which was remotely registered here
continued running - and - IT IS GLASSFISH which grew constantly !!!

This was not visible to me in Windows Task Manager so far and first time monitored when GF was started independently
because of the remote registration!

So this looks like an Issue for the GlassFish Team.

Comment 8 _ pcw 2007-12-21 17:07:58 UTC
Glassfish V2 UR1 was just released yesterday.  Could you redo your tests against that release and see the leak is still
present in that version?

You can download it here: https://glassfish.dev.java.net/downloads/v2ur1-b09d.html
Comment 9 bernd_zedv 2007-12-21 19:16:24 UTC
Repeated my tests with GF v2ur1-b09d.

GF stops growing at round about 450 MB memory - looks like it starts GC then.

I did not run the prior tests often enough to reach this limit.

Maybe I got Out-Of-Memory some weeks ago when NB also reached 500 MB and
my 2 GIGs where not enough for this and everything else.

This issue can be closed


Comment 10 _ pcw 2007-12-21 21:12:23 UTC
I don't think GC decisions are made based on available RAM (but I could be wrong).

I think there was a memory leak in V2, patched in UR1 that could have been what you were experiencing.  If you see
further trouble with UR1, feel free to open an issue on glassfish.dev.java.net and we can look at it further.
Comment 11 _ pcw 2007-12-21 21:14:49 UTC
One more point - to monitor memory usage by NetBeans, you can enable the memory display on the toolbar.  Right click the
toolbar, select customize and check <Memory>.  A toolbar component showing current memory usage will show up.  Clicking
on it will force a GC.