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 43839 - After a lot of execution of the Build Script, I receive a Out of Memory Error
Summary: After a lot of execution of the Build Script, I receive a Out of Memory Error
Status: CLOSED DUPLICATE of bug 43113
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 4.x
Hardware: PC Other
: P3 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords: PERFORMANCE
Depends on: 43113
Blocks: 41537
  Show dependency tree
 
Reported: 2004-05-25 16:11 UTC by vbrabant
Modified: 2006-03-24 09:49 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Zip file of a stupid application + sanity check directory (light) (1.54 MB, application/octet-stream)
2004-06-28 20:34 UTC, vbrabant
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vbrabant 2004-05-25 16:11:30 UTC
NB200405182245 & JDK 1.4.2
I have a little project.
That project contains the build.xml
I modified the build.xml file to have the following
    <import file="sanity-check.xml"/>
    <target name="post-init"
depends="init-sanity-checks">
    </target>
    <target name="run-all-sanity-check" 
            description="run all sanity checks"
            depends="all-sanity-checks" />

I created another sanity-check.xml file
that contains a target all-sanity-checks that
depends of init.
That sanity-check.xml is running checkstyle, pmd,
jdepend, findbugs, cpd.

I right click on build.xml and select target
run-all-sanity-checks.
I can run it how many times I want, until I have a
OutOfMemory Exception.
And GC indicates 24.8/48Mb
Only thing I can do is restart NB and problems
disappeared until the next time I reached somes
limitation.

Any idea what could be the problem ?
Comment 1 Jesse Glick 2004-05-25 17:59:51 UTC
Missing steps to reproduce.

Petr may know something about this.... permanent heap size again?
Comment 2 vbrabant 2004-05-25 18:20:47 UTC
Do you want that I joined a zip file with all the project and external
lib I use in the Ant Script file ?
Then you will certainly be able to reproduce it.
Comment 3 Jesse Glick 2004-05-25 18:36:09 UTC
Sure, if you can produce some ZIP file that I can unpack, mount in a
dev build with a fresh user dir, and run over and over (specify which
target(s)), that could be helpful I think.
Comment 4 Petr Nejedly 2004-05-26 11:34:57 UTC
Actually, this is a known problem but you may have easier/faster way
to reproduce it. Please read issue 43113 and try starting visualgc
(from jvmstat package) against your OOME-throwing JVM. Is should show
the occupation ot the permanenet area of heap and also should show
number of classes loaded and unloaded. Try gc() several times, again
after few minutes and check the perm heap and the number of unloaded
classes again, whether it improved. And tell us, of course ;-)

*** This issue has been marked as a duplicate of 43113 ***
Comment 5 Jesse Glick 2004-05-26 16:30:23 UTC
Petr, is visualgc even publicly available anywhere?

Anyway Vincent if you have a good way to reproduce easily and quickly,
that alone would be a big help.
Comment 6 Petr Nejedly 2004-05-27 08:29:45 UTC
Sure, it is:
http://developers.sun.com/dev/coolstuff/jvmstat/
Comment 7 Petr Nejedly 2004-06-10 17:09:28 UTC
Vincent, have you reproduced the problem with some newer build?
Comment 8 vbrabant 2004-06-17 21:21:59 UTC
I just installed the NB20040616 and I can't reproduce the same problem.

I mean, I am not receiving the OOME.

But I receive, under the same circonstances, the following errors:


java.io.FileNotFoundException: D:\Test_20040518_NB4.0\Test Unitaire En
Java\build.xml (Bad file descriptor)

For your information, I received that message during the 7
temptatives, after 6 successfull run.

So, I suppose that the under that exception we have the same problem
than before.

I tried visualgc, but seems that it's not working under win98. Sorry.

I will clean my project and send it to you as zip file. Maybe next
week. (Sorry for the delay, but I have a lot of work at my work, at
home, and with refactoring issues I filled).

Comment 9 Jesse Glick 2004-06-17 22:58:18 UTC
Re. the FileNotFoundException - strange, haven't heard of anything
like this before. File it as a separate bug if you get a chance to
pull together a test case. Thanks!
Comment 10 vbrabant 2004-06-18 15:36:48 UTC
Hi Jesse.
In fact, I think the problem was that NB runs on my JDK1.5 JVM (Beta 1).

But no idea why NB ignore the netbeans.conf file (it's the trunk
release 200406161800).

Hereafter the content of netbeans.conf

netbeans_default_userdir="${HOME}/.netbeans/20040616"
netbeans_default_options="-J-Xms24m -J-Xmx160m
-J-Dnetbeans.logger.console=true -J-ea"
netbeans_j2sdkhome="C:/programfiles/javasoft/j2sdk1.4.2_01"

After NB started, I checked the About Detail and see that 
Java Home is c:\j2sdk1.5.0\jre
User Dir is c:\Windows\.netbeans\20040616

It means that the exec has well take into account the
netbeans_default_userdir but not the netbeans_j2sdkhome

Any idea why ?
Comment 11 Jesse Glick 2004-06-18 15:45:18 UTC
netbeans_j2sdkhome="C:/programfiles/javasoft/j2sdk1.4.2_01"

looks suspicious - '/' instead of '\', the lack of a ' ' in
"programfiles".

Please file a separate bug for this (core/code, assign to
ttran@netbeans.org); if you know how to reproduce the problem
(preferably starting with the Windows installer) certainly attach that
information.
Comment 12 vbrabant 2004-06-18 16:15:29 UTC
Anyway, I success to force JDK 1.4.2 by using the --jdkhome switch.

And I success to have the OOME :-(

Just after 10 minutes works.

As said, I will prepare a zip therefore (somewhere next week).

Could you clarify somes questions I have:

1. Is the Ant script running in another JVM than the netbeans one ?
2. Why, if I have a OOME, the Memory Meter is not indicating that
memory is full (At this time, it indicates 38Mo / 78Mo)?
Comment 13 vbrabant 2004-06-18 16:22:22 UTC
Hi Jesse,

you said the following: 
  netbeans_j2sdkhome="C:/programfiles/javasoft/j2sdk1.4.2_01"
  looks suspicious - '/' instead of '\', the lack of a ' ' in
  "programfiles".

But the same netbeans.conf file is working like a charm with 20040525.

And giving parameters with / to the exec file, is also working.

As you said, I will therefore create a new issue.
But I need to download the installer (I downloaded the zip and unzip
it, as I always said in the past)
Comment 14 Jesse Glick 2004-06-18 16:29:06 UTC
"1. Is the Ant script running in another JVM than the netbeans one?" -
no, same JVM.

"2. Why, if I have a OOME, the Memory Meter is not indicating that
memory is full (At this time, it indicates 38Mo / 78Mo)?" - well
that's what I would like to find out if I knew how to reproduce the
problem!

"But I need to download the installer (I downloaded the zip and unzip
it, as I always said in the past)" - well if you encountered the
problem without using the installer, then of course file steps not
involving the installer. If the same netbeans.conf worked before and
it does not now, that is probably a regression and should be
investigated (unless the format was invalid for some reason and this
was just not detected before). In any event, the issue should mention
that the conf file is using the wrong separator; if the IDE generated
this line for you, that may be a bug (in the installer or
netbeans.exe, depending on what generated it).
Comment 15 vbrabant 2004-06-28 20:34:39 UTC
Created attachment 16047 [details]
Zip file of a stupid application + sanity check directory (light)
Comment 16 vbrabant 2004-06-28 20:43:08 UTC
I attached my project + the sanity check.
You just need to mount MyFirstProject and select the build file to
execute the target run-all-sanity-check.
You certainly need to modify the sanitycheck.properties file for the
property sanitycheck.tools.dir that must point to the
sanitycheck_tools directory.

I created a menu shortcut of the task, and click 20-30 times one after
another one until I receive the OOME.

Enjoy 
Comment 17 Petr Nejedly 2004-07-07 14:21:52 UTC
Vincent, thanks for the example script, it displays the problem pretty
clearly. I've added you to cc of issue 43113, you can read partial
explanation of the problem there.
Summary: OOME is caused by "Permanent generation" overflow. PermGen
size is not reported by the System.*Memory methods, so it can't be
tracked by the memory metter. But once PermGen hits its limit (64MB),
it OOMEs regardless of free java heap.
PermGen is used by JVM to store classes, their metadata and interned
Strings and redundant class loads are the culprit here.
Comment 18 vbrabant 2004-07-07 18:40:12 UTC
How can I see the size of the PermGen in a JRE ?
How can I give more size for the PermGen ?

Comment 19 Marian Mirilovic 2005-07-12 10:13:39 UTC
closed