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 55344 - Frequent OOME from PermGen when using J2EE functionality
Summary: Frequent OOME from PermGen when using J2EE functionality
Status: CLOSED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 4.x
Hardware: PC All
: P1 blocker (vote)
Assignee: _ rkubacki
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2005-02-22 11:43 UTC by _ rkubacki
Modified: 2006-03-24 13:07 UTC (History)
1 user (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 _ rkubacki 2005-02-22 11:43:40 UTC
There are frequent reports that when J2EE
functionality is used in the IDE OutOfMemoryError
is thrown reporint full permanent generation area.

Some problems were already fixed (issues #55015)
some other needs to be investigated.
Comment 1 _ rkubacki 2005-02-22 11:45:30 UTC
Permanent generation is an area in java heap where the following
objects are stored

   1. Symbols (method names, class names, field names, signatures etc.)
   2. intern'ed String objects. (refer to java.lang.String.intern method)
   3. meta data (InstanceKlass, Method objects, ConstantPool,
ConstantPool cache objects etc.) for java classes. 

Symbols are shared between multiple classes and so can not be
attributed to a specific class. same can be said about intern'ed
String objects.
Comment 2 _ rkubacki 2005-02-22 12:43:47 UTC
Maybe that we really have too many classes and run out of the space
even wothout any leak.

I tried to start the IDE, create a J2EE project, add seesion EJB, add
a method, add servlet calling this EJB, create an INSANE dump, start
the app server, build the web module, browse nodes in runtime and get
to the state with full perm gen. After start there were 7100 classes.
after playing w/ J2EE functionality it grew to ~10000, INSANE caused
resolving of many other classes and it grew to 13000 (800 unloaded)
and next few operations were required to reach 13800/900 and full permgen.
Comment 3 _ rkubacki 2005-02-22 13:41:40 UTC
We really do not fit into memory. My attempt to put all NetBeans JARs
ona classpath load all classes into JVM (without resolving) failed
when 17717 classes were loaded. Looking at jstat -gc and -class output
classes occupies 22228.5 but permgen is full at this moment.

-J-XX:MaxPermSize should help. I am not sure what should be the limit.
80MB?
Comment 4 Antonin Nebuzelsky 2005-02-22 13:49:30 UTC
Adding extra 16MB to the current 64MB of perm area is IMHO fine.

But I think we should release-note that the users may run out of perm
area (for example with complex ant scripts using custom tasks) and
that they should increase from -XX:MaxPermSize=80m to something higher
in such a case.
Comment 5 _ rkubacki 2005-02-22 15:23:36 UTC
80MB is enough to load 19678 classes into 72873kB. Of course we need
to load more classes from JDK, Ant classes for building and some other
stuff (MDR generated classes, DB drivers) but it is unlikely that we
will need all these during one run.
Comment 6 _ rkubacki 2005-02-22 15:46:24 UTC
Unfortunately if I use Class.forName(name,true,cl) it loads 20058
classes and requires 84955.8kB
Comment 7 Antonin Nebuzelsky 2005-02-22 16:09:44 UTC
OK, as discussed I am going to add -J-XX:MaxPermSize=96m to
ide/launcher/netbeans.conf in both trunk and release41_beta branch
after QA confirms this does not prevent IDE from starting on all
supported platforms/JDKs.
Comment 8 Antonin Nebuzelsky 2005-02-22 16:58:17 UTC
-J-XX:MaxPermSize=96m is now
in ide/launcher/netbeans.conf
in both trunk and release41_beta
Comment 9 Petr Jiricka 2005-02-23 10:14:08 UTC
Thanks. Marking as fixed, please reopen if the problems reappear.

Comment 10 Lukas Jungmann 2005-07-12 14:04:04 UTC
v.