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.
Profiling memory usage incorrectly indicates memory leak. While profiling an application recently I discovered an issue where the profiler indicated a memory leak. However on further examination via a unit test the memory usage was constant. I originally raised this case against the search library lucene (see the reported error at http://issues.apache.org/jira/browse/LUCENE-842). There is a code example in that report TestParallelMultiSearcherMemLeak.java which requires the library lucene-core-2.1.0.jar (available at http://lucene.apache.org/java/docs/releases.html). Running the unit test shows constant memory usage however running with-in the profile exhausts maximum heap memory setting with an OutOfMemory exception. I believe the problem may result from the use of joined threads in the lucene code file ParallelMultiSearcher.java (see lucene code src download). If using the sequential MultiSearcher.java the leak does not manifest.
Does the test involves creating a lot of new threads? I guess so based on the test name TestParallelMultiSearcherMemLeak, but I am not sure.
In the example TestParallelMultiSearcherMemLeak it is actually only creating a one thread (controlled by the variable N_INDEXES). However the the code file ParallelMultiSearcher.java essentially N_INDEXES treads are created and started. Basically the logic is as follows; * Create N threads * Start each thread running * For each thread join (wait for each to die).
OK, so it looks like you are having issue #95020. It is already fixed and there is even patch for NetBeans Profiler 5.5. *** This issue has been marked as a duplicate of 95020 ***
Verified duplicate