File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JVM suddenly consumes large memory and crashes server

 
Kotto Bass
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • 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
JVM Memory Usage
[Thumbnail for memory usage.JPG]
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We increased the MaxPermSize from 256 to 512 and that resolved the issue. Thanks Ernest!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic