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 86240 - Memory leak in am deploy
Summary: Memory leak in am deploy
Status: CLOSED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Identity (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Peter Liu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-30 01:42 UTC by Peter Liu
Modified: 2006-10-18 21:59 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 Peter Liu 2006-09-30 01:42:52 UTC
After profiling our memory usage during deployment and following the "PermGen
Space Error" email thread, it looks like we have a memory leak issue during
deployment very similar to what is described in the email thread. 

The way deploy currently works is that the each time our ant task is invoked, a
new copy of the profileapi module gets loaded along with the client sdk and
other required jar files. For some reason, which is unclear to me right now, is
these classes do not get gargage collected.  I also noticed multiple instances
of the ClassLoaderManager sticking in memory which furthuer suggests the memory.

Furtunately, the solution to this problem is documented in the "PermGen Space
Error" email thread.  I've tried it and it work. Basically, the solution is to
reuse the profileapi module already loaded by NB by registering our amdeploy
task as a NB ant task.  For running outside the IDE, we modify our build script
to check for netbeans.home, if it is not defined, we will defined the amdeploy
task as before, otherwise, we skip it.  Note that a side-effect of this fix is
deployment performance inside the IDE is not drastically improved because we
only load and initialize the client sdk once which is very time consuming.

I'll do more testing on this before requesting the bug council to approve the fixes.
Comment 1 Peter Liu 2006-10-02 22:16:33 UTC
The following is the commit log for the fixes into the release55_dev branch.

IDE:-------------------------------------------------
IDE: [10/2/06 2:04 PM] Committing "Identity Ant Tasks" started
Checking in build.xml;
/cvs/identity/ant/Attic/build.xml,v  <--  build.xml
new revision: 1.1.2.3.4.1; previous revision: 1.1.2.3
done
Checking in antsrc/org/netbeans/modules/identity/ant/AMDeploy.java;
/cvs/identity/ant/antsrc/org/netbeans/modules/identity/ant/Attic/AMDeploy.java,v
 <--  AMDeploy.java
new revision: 1.1.2.26.2.1; previous revision: 1.1.2.26
done
Checking in src/org/netbeans/modules/identity/ant/IdentityAntTasks.xml;
/cvs/identity/ant/src/org/netbeans/modules/identity/ant/Attic/IdentityAntTasks.xml,v
 <--  IdentityAntTasks.xml
new revision: 1.1.2.5.2.1; previous revision: 1.1.2.5
done
IDE: [10/2/06 2:04 PM] Committing "Identity Ant Tasks" finished

IDE:-------------------------------------------------
IDE: [10/2/06 2:11 PM] Committing "Identity Profile API" started
Checking in AMConfigManager.java;
/cvs/identity/profileapi/src/org/netbeans/modules/identity/profile/api/configurator/impl/file/Attic/AMConfigManager.java,v
 <--  AMConfigManager.java
new revision: 1.1.2.7.2.1; previous revision: 1.1.2.7
done
IDE: [10/2/06 2:11 PM] Committing "Identity Profile API" finished
IDE: [10/2/06 2:11 PM] Diffing "AMConfigManager.java" finished

IDE:-------------------------------------------------
IDE: [10/2/06 2:14 PM] Committing "Identity Profile UI" started
Checking in am-deploy.xsl;
/cvs/identity/profileui/src/org/netbeans/modules/identity/profile/ui/support/resources/Attic/am-deploy.xsl,v
 <--  am-deploy.xsl
new revision: 1.1.2.6.2.1; previous revision: 1.1.2.6
done
IDE: [10/2/06 2:14 PM] Committing "Identity Profile UI" finished
Comment 2 Michael Frisino 2006-10-05 10:26:55 UTC
what will be the delta b/t today sample projects and post-fix project? What
exactly will be changing. If you document this it will be easier for  QE to
track any ommissions. We have had a terrible time the last two weeks with
constant churn in the samples due to project system changes. Hopefully, we can
do a better job this cycle. If you document what is being changed it will help.
Comment 3 Peter Liu 2006-10-07 05:53:47 UTC
changes checked into release55 branch.
Comment 4 Peter Liu 2006-10-18 21:59:32 UTC
Verified in build 061015.