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 41715 - Memory leak when doing repetitive CVS Update or Refresh
Summary: Memory leak when doing repetitive CVS Update or Refresh
Status: RESOLVED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: vcscore (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P2 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords: PERFORMANCE
Depends on: 32089
Blocks:
  Show dependency tree
 
Reported: 2004-04-05 16:49 UTC by Antonin Nebuzelsky
Modified: 2004-08-13 12:12 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Snapshot of jprofiler window after 2nd CVS update (93.81 KB, image/png)
2004-04-05 16:52 UTC, Antonin Nebuzelsky
Details
Snapshot of jprofiler window after 3rd CVS update (93.99 KB, image/png)
2004-04-05 16:52 UTC, Antonin Nebuzelsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonin Nebuzelsky 2004-04-05 16:49:44 UTC
Repeating CVS Update action on the same VCS FS
shows a significant increase in memory usage.
Memory meter shows the following heap usage
numbers for updates on checked out nb_all/core module.

after start of the IDE (VCS FS already mounted and
checked out) - 13,1 MB
after 1st update action - 15,5 MB
after 2nd update action - 17,9 MB
after 3rd update action - 20,2 MB

This means roughly 2,4MB memory leak per one
update action on a filesystem size of nb_all/core
module.

Profiler indicates that (among others) the
increased consumption is caused by instances of
o.n.m.vcscore.cache.CacheReference,
o.n.m.vcscore.caching.VcsCacheFile$VcsPersistentData,
java.io.File (referenced by the objects above), 
javax.swing.text.GapContent$MarkData,
javax.swing.text.GapContent$StickyPosition,
javax.swing.text.AbstractDocument$LeafElement ...
Comment 1 Antonin Nebuzelsky 2004-04-05 16:52:06 UTC
Created attachment 14282 [details]
Snapshot of jprofiler window after 2nd CVS update
Comment 2 Antonin Nebuzelsky 2004-04-05 16:52:39 UTC
Created attachment 14283 [details]
Snapshot of jprofiler window after 3rd CVS update
Comment 3 Antonin Nebuzelsky 2004-04-05 17:27:11 UTC
The same leak appears when you do Refresh Recursively on the checked
out nb_all/core module. The size and structure of the leak is the
same, vcs cache being the obvious culprit.
Comment 4 Martin Entlicher 2004-04-05 22:33:59 UTC
It's a surprise for me that the number of CacheReference instances
grows. These are created as references for AbstractFileObjects and old
unused objects should be garbage-collected.
Perhaps the fact that they are SoftReference cause some problem?

Scheduling for promotion D. The mechanism of the leak has to be
investigated and we need to prevent it in the cache redesign (issue
#32089).
Comment 5 _ pkuzel 2004-07-23 21:45:23 UTC
First scan. There is one obvious bug that SoftReference subclass holds
some data (File and cache Id). These behave as hardreferenced.
Comment 6 _ pkuzel 2004-07-23 21:59:45 UTC
It seems to me that CacheReference.getCacheFile() and
CacheReference.getCacheName() are never called so associated fields
could be removed. File is quite big object as it holds absolute path.
Comment 7 _ pkuzel 2004-07-23 22:11:59 UTC
SoftReferences itself cannot be the problem because it's manifested by
repeating the refresh operation over the same data. So there is no
need to create new references, old unreleased should be reused.
Comment 8 _ pkuzel 2004-07-26 13:26:58 UTC
CacheReference leak eliminated. 
CacheHandler.java new revision: 1.18

Checker, please note that Runtime -> VCS Commands can keep huge amount
of history. For 3x nb_all/core recursive updates it's about 12MB. But
it's not leak by itself because setting limit to 0 (default 20)
releases this memory.