• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JVM suddenly consumes large memory and crashes server

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

I'm experiencing an anormally with JRun application server running on SUN JVM. Averagely about once a week, the server crashes without any warnings. On monitoring the memory usage, I noted that there was an unexpected jump in JVM total memory eventhough applications were not requesting extra memory. Attached is a sample screenshot with a browser-based monitoring tool from Adobe. It's showing that at about 11:58am, there was a sudden spike in JVM memory from about 384MB up to about 1022.44MB which crashed the server. The only thing I could find in the logs was a message stating: 'Permgen Space' error. There were no warnings/errors before the crash. The virtual memory used by JRun when it crashed was about 1.3GB. Any thoughts?

My environment is: JRun4 on JVM1.6.0_04 with max heap size (-Xmx) set to 1024m.
memory-usage.JPG
[Thumbnail for memory-usage.JPG]
JVM Memory Usage
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're running out of space in the "permanent generation", where the contents of class files (classes, String literals, other fun stuff) is held. You can try bumping up the space for that memory area using

-java XX:MaxPermSize=NNNm
 
Kotto Bass
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ernest Friedman-Hill wrote:You're running out of space in the "permanent generation", where the contents of class files (classes, String literals, other fun stuff) is held. You can try bumping up the space for that memory area using

-java XX:MaxPermSize=NNNm



That looks good, but if you look at the attachment on the original post, the JVM total memory hits the max heap space allocated and (not shown on the graph) starts eating OS virtual memory. The 'used' memory remains low however. As an aside, our MaxPermSize is set to 250MB and max heap size set to 1024MB.
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That could just be evidence that the JVM tried everything it could do to free up space, including a full GC sweep and then calling sbrk() to grow the address space, before finally giving up. I'm not sure it's smart enough to know whether these measures are going to work or not in advance -- it might be obvious to us that it was a hopeless gesture, but it might not be obvious to it.
 
Kotto Bass
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We increased the MaxPermSize from 256 to 512 and that resolved the issue. Thanks Ernest!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic