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 25753 - Memory leak caused by a running ant target
Summary: Memory leak caused by a running ant target
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P2 blocker (vote)
Assignee: David Konecny
URL:
Keywords: PERFORMANCE
: 27625 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-07-17 17:19 UTC by Jan Pokorsky
Modified: 2008-02-17 14:53 UTC (History)
4 users (show)

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 Jan Pokorsky 2002-07-17 17:19:34 UTC
If I run the ant target several times (5-20x) I get OutOfMemoryError without an available stack 
trace. I'm able to reproduce it reliably only with jdk1.3.1 but not at all with 1.4.

In order to reproduce the bug I'm using projects/test/built.xml/runtests target. No matter the 
target is launched from an explorer or a toolbar shortcut. To get sources look at 
http://projects.netbeans.org/proposals/prototype/index.html, stripped version, 
prj40_prototype branch.

In most cases the ide freezes during or after a xsl transformation, I guess (according to the 
output tab).
Comment 1 Marek Grummich 2002-07-22 08:18:41 UTC
Target milestone was changed from '3.4' to TBD.
Comment 2 David Konecny 2002-07-22 16:08:17 UTC
I played with this problem and I can confirm that there is a 
_problem_. Unfortunately I don't have idea how to continue, how to 
track the bug. 

If I execute the JUnit tests from the IDE about 5x-6x times the IDE 
(Build 200207100858 on JDK 1.3.1_02) suddenly does following:
* the running script is stopped at random place (from what I can see 
in the output window)
* execution view portion of the output window contains "No Processes 
Running"
* the IDE is frozen - I can minimize/maximize it, but no repaint is 
done
* thread dump is _empty_ - bunch of threads, but nothing important 
there

After a while IDE simply dies - not message box, no record in log 
file, nothing. Sometimes I had to kill the process.

This behaviour is reproducible. I was executing the Ant scripts with 
DEBUG verbosity level and IDE crashes always at the different place: a 
few times if was at the end of fifth execution (just when the XSL 
processing is running), but once it happened early after the sixth 
execution. I was tracking the memory (via Memory View) and it does not 
shown any problems: the memory is all the time around 25-46MB.

Has anybody some hints what to check, try, do??
Comment 3 Jesse Glick 2002-07-23 00:16:44 UTC
For now may just have to document that users of XTest should beware of
in-IDE execution, until we figure out what is wrong. David I suggest
the IDE in this state be run through e.g. OptimizeIt! (we have a site
license, let's use it) to find the memory leaks.
Comment 4 _ ttran 2002-07-23 10:57:10 UTC
added PERFORMANCE keyword
Comment 5 Jan Pokorsky 2002-07-23 11:58:33 UTC
I am afraid targets running xtests is not the only case. Building 
the ide or just modules alone results in the same issue after several 
uses. Possible workaround seems to be a migration to jdk 1.4.x
Comment 6 David Konecny 2002-07-23 14:24:35 UTC
Other observations:
* I tried to build project prototype from the IDE (see Jan's url for 
more details about projects prototype - it is openide, core, projects, 
java, editor and a few other modules). The build contained also first 
start of the IDE. The IDE died after 10th execution of build script.
* I tried the same as above just without first start. The IDE died 
after about 13th execution. But this time I got also:

 #
 # HotSpot Virtual Machine Error, Internal Error
 # Please report this error at
 # http://java.sun.com/cgi-bin/bugreport.cgi
 #
 # Error ID: 4349254E560E43505000F4
 #
 # Problematic Thread: prio=5 tid=0x983cc8 nid=0x548 runnable
 #

That means that the problem is not related to XTest/JUnit scripts 
only, but to all Ant scripts in general.

I think it is JVM bug. As Honza writes, on JDK 1.4 this issue does not 
happen. Therefore I tend to close it as WONTFIX. Before I do so I 
would like to give a try OptimizeIt.
Comment 7 Patrick Keegan 2002-07-23 16:53:12 UTC
Proposed readme text:

"Description: If you run an Ant target in the IDE multiple times in rapid succession, an out of memory 
error may occur. This error occurs on JDK 1.3.1.

Workaround: Run the IDE on JDK 1.4."

Does this sound OK?
Comment 8 Jesse Glick 2002-07-24 05:54:20 UTC
The relnotes text sounds OK to me.
Comment 9 Jesse Glick 2002-07-24 05:54:52 UTC
Patrick you have to add yourself as a CC when adding comments to a bug
or you won't see replies...
Comment 10 David Konecny 2002-07-24 11:54:34 UTC
I tried OptimizeIt, but did not learn much. The Ant module classes 
looked OK. Closing as WONTIX.
Comment 11 Jan Pokorsky 2002-07-24 12:48:04 UTC
To David: Does it mean we do not support to use the ant module for 
execution with jdk1.3.1 in future?

To Patrick: It does not matter how rapid the succession is. Otherwise 
OK.
Comment 12 David Konecny 2002-07-24 14:12:48 UTC
Adding pnejedly & jlahoda on the cc:. Jan has a bit similar problem. 
Jan, could you explain your problem?
Comment 13 David Konecny 2002-09-27 09:40:29 UTC
jpokorsky told me that after running IDE on JDK 1.4 for longer time
(>1day) the problem appeared there too.
Comment 14 David Konecny 2002-10-03 08:54:48 UTC
*** Issue 27625 has been marked as a duplicate of this issue. ***
Comment 15 David Konecny 2002-10-03 08:57:44 UTC
Attaching information I got from originator of issue 27625:

I know that in my previous job, we saw this problem when we were
creating several instances of javac to compile repeatedly. So it leaks
some kind of handles like file handles and in the AWT thread there is
a silent quit without any notification on that kind of leak. If you
see the thread dump carefully, you will see there in NO
AWT-Event-Queue thread. I think this bug is similar 4517726 on bug parade:

<http://developer.java.sun.com/developer/bugParade/bugs/4517726.html>

So my guess is that ANT is creating too many instances of javac (or
something like that) and that is causing this bug to trigger. Do we
run ANT inprocess? If so, making it out of process (optionally) can
possibly help. We might also want to look at how many instances of
ANT/Javac we are creating and try to minimize those.
Comment 16 Jesse Glick 2002-10-03 15:24:24 UTC
I seem to recall that there have been major cleanups in Javac code for
recent JDK releases (sorry, forget details) - basically meaning that
it should now be really reentrant and clean up after itself properly.
Yes, NB currently only runs Ant in-VM.
Comment 17 cirvine 2002-10-13 16:57:47 UTC
I believe that I am seeing this problem. I've recently 
started using XDoclet and the problem occurs frequently, 
i.e. after about an hours constant use. I understand that 
if I go to 1.4 the problem would mitigated somewhat, but 
unfortunately I'm stuck with 1.3 for a couple of reasons. 
First, our target platform is OS390/Linux where 1.4 is not 
yet supported. Secondly, when I run 1.4 on WinNt I get 
critical errors (application aborts) having to do with a 
spurious interaction with Microsoft's Direct Draw.

Would you consider re-opening this problem? Plus, it seems 
like a P1 to me.
Comment 18 David Konecny 2002-10-14 09:14:45 UTC
Could PERFORMANCE team look at this? I do not have time to work on
this issue at the moment.
Comment 19 Jesse Glick 2002-10-14 20:25:55 UTC
Chuck, re. 1.4, in case it is helpful for you - (1) remember you can
run NB under 1.4 and still develop for 1.3 (I guess you know this);
(2) I think there is some way to turn off DirectDraw support in AWT in
case your driver is buggy or something. Don't remember offhand how.
Comment 20 Patrick Keegan 2004-03-04 22:40:33 UTC
removing RELNOTE keyword as jdk 1.3 is no longer supported
Comment 21 Marian Mirilovic 2005-07-15 07:44:46 UTC
closed
Comment 22 mprpatel 2008-02-17 11:11:25 UTC
what kind of forum is this? not giving any kind of solution for our problem???? we are working on the same problem 
since a week and still not getting the problem.. we get the error of "outofmemory"... the first worst thing about 
netbeans is that it takes eons to startup its modules and then works too slow giving errors of out of memory... we 
have a 2GB RAM with 360GB hard disk and still the same problem... do we have to buy a super computer and make netbeans 
work on it?? we are plannin to change the IDE if the same problem persists... netbeans is really the worst IDE... 
sorry, but before changing the IDE would like to have a solution to memory problem if you can suggest
Comment 23 Jesse Glick 2008-02-17 14:53:55 UTC
Spuriously reopened.