Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / February 2004

Tip: Looking for answers? Try searching our database.

JDK:1.2.2->Memory leaks in Class loader, Jar handling parts

Thread view: 
qazmlp - 10 Feb 2004 15:21 GMT
Has anybody noticed the memory leaks due to the class loader,Jar
handling parts of Java?
The heap profiling that I did for my Java process reports huge leaks
in these areas.

Here are some of the sample stacks that HAT reports:
1)
Stack
-----
TRACE 6924:
 java/lang/String.<init>(String.java:Compiled method)
 java/util/jar/Manifest.parseName(Manifest.java:Compiled method)
 java/util/jar/Manifest.read(Manifest.java:Compiled method)
 java/util/jar/Manifest.<init>(Manifest.java:Compiled method)
 java/util/jar/JarFile.getManifest(JarFile.java:Compiled method)
 sun/misc/URLClassPath$JarLoader.getClassPath(URLClassPath.java:Compiled
method)
 sun/misc/URLClassPath.getLoader(URLClassPath.java:Compiled method)
 sun/misc/URLClassPath.getResource(URLClassPath.java:Compiled method)
 java/net/URLClassLoader$1.run(URLClassLoader.java:Compiled method)
 java/net/URLClassLoader.findClass(URLClassLoader.java:Compiled
method)

Memory dump
-------------
         percent         live       alloc'ed    stack  class
rank   self   accum   bytes  objs  bytes  objs   trace  name
132    0.10%  66.16%  54888  593   54888  593    6924   [C

2)
Stack
-----
TRACE 2776:
 java/lang/String.<init>(String.java:Compiled method)
 java/util/jar/Manifest.parseName(Manifest.java:Compiled method)
 java/util/jar/Manifest.read(Manifest.java:Compiled method)
 java/util/jar/Manifest.<init>(Manifest.java:Compiled method)
 java/util/jar/JarFile.getManifest(JarFile.java:Compiled method)
 sun/net/www/protocol/jar/URLJarFile.isSuperMan(URLJarFile.java:115)
 sun/net/www/protocol/jar/URLJarFile.getManifest(URLJarFile.java:Compiled
method)
 java/util/jar/JarFile.getInputStream(JarFile.java:Compiled method)
 sun/net/www/protocol/jar/JarURLConnection.getInputStream(JarURLConnection.java:124)
 java/net/URL.openStream(URL.java:818)

Memory dump
-------------
        percent          live        alloc'ed   stack  class
rank  self   accum    bytes  objs   bytes  objs  trace  name
164   0.08%  69.06%   42312  452    42312  452   2776   [C

There are 30-40 such similar stacks shown in the report.

Here is the JDK version that I use:
java version "1.2.2"
Solaris VM (build Solaris_JDK_1.2.2_08, native threads, sunwjit)

Is this a known leak?
Please share if you have any information on this.

Thanks!
Chris Smith - 10 Feb 2004 15:36 GMT
> Has anybody noticed the memory leaks due to the class loader,Jar
> handling parts of Java?
> The heap profiling that I did for my Java process reports huge leaks
> in these areas.
>
> Here are some of the sample stacks that HAT reports:

Can't say I'm really familiar with HAT, and therefore with what you are
seeing wrong with these stack traces or what they mean.

It looks to me like the objects being allocated at these traces are part
of the URLClassLoader's internal state regarding the JAR files for its
classes.  I'd expect it to last potentially just as long as the
ClassLoader does before becoming collectable.  Since most applications
don't cycle ClassLoader instances frequently (if at all), I'd expect
these strings would stick around for a long time... quite likely until
the application exits.  If that's what you're observing, then it's not a
memory leak; it's simply the data used by the ClassLoader to do its
work.

I'd also be surprised if Strings from a manifest file really took up a
substantial amount of space, though.  Are these Strings causing you
memory problems?

Signature

www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation

Andrew Thompson - 10 Feb 2004 16:34 GMT
...
> Here is the JDK version that I use:
> java version "1.2.2"
> Solaris VM (build Solaris_JDK_1.2.2_08, native threads, sunwjit)

Sorry to divert your thread qazmlp, but..

Wow!  An actual 1.2 jar!  I was beginning
to think that those were the product of a
fevered imagination..

I would like to add 1.2 support to my
on-line compiler.  How big is it?

--
Andrew Thompson
* http://www.PhySci.org/ Open-source software suite
* http://www.PhySci.org/codes/ Web & IT Help
* http://www.1point1C.org/ Science & Technology


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.