• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

OutOfMemory

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

We are running a stress test for a web application. And, after a 4 hours of heavy load the app server (WAS) crushes with OutOfMemory error.
The following piece is from GC log:



It looks like there are a lot of soft references to the sun.reflect.GeneratedMethodAccessor class and GC cannot properly clean it. But we don�t use soft references directly.
I am just wondering why this class is used and by whom?

Thanks.
 
Ranch Hand
Posts: 116
Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't answer your question specifically...
The VM is required to free all SoftReference references before returning an OutOfMemory exception. You are probably seeing that behavior in the log file. Its doing what it is supposed to but it can't free up enough to satisfy the memory request.

see http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ref/SoftReference.html
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
GC tries its best to recover memory before throwing this error.
GC is definately making sure that all the softreferences are resolved before it throws this error.There might be something else in your program which is leading to this error.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[Ludmilla]: It looks like there are a lot of soft references to the sun.reflect.GeneratedMethodAccessor class and GC cannot properly clean it. But we don�t use soft references directly. I am just wondering why this class is used and by whom?

I don't know exactly, but it's something using reflection. Does your code use reflection? Perhaps it's your testing framework - e.g. JUnit uses reflection to access each test method. I would think that for every test method, there's a GeneratedMethodAccessor subclass created to access it. After the method completes, that class can become eligible for GC.

What part of the output suggests that GC cannot properly clean the GeneratedMethodAccessor classes? Or that the soft reference are references to that class? Could be completely unrelated, I think. One way or another, you ran out of memory, but I don't see an indication that either the GeneratedMethodAccessor or the soft references are the cause of the problem. They're just among the many things that GC does. I would look for a memory usage profiler to determine what is actually taking up most of the memory at the time of the OOME. Don't assume it has anything to do with soft references or GeneratedMethodAccessor.
[ April 27, 2007: Message edited by: Jim Yingst ]
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I think your problem is leaving references to objects inside a cache (Hashtable) or similar structure.. make sure they Value does not have a pointer to the key in the structure.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic