JVM crash due to perm gen space 99% in use

简介:

问题描述:

 
  1. TransformerFactory tFactory = TransformerFactory. newInstance (); 
  2. Transformer transformer = tFactory.newTransformer(new StreamSource(inputStream));
  3. transformer.transform(xmlSource, outputTarget);//crash here

JAVA代码中调用Transformer转换xslt文件到xml文件时出现crash,crash 文件摘要:

 
  1. Heap 
  2.  def new generation   total 314560K, used 5786K [0x04600000, 0x19b50000, 0x19b50000) 
  3.   eden space 279616K,   2% used [0x04600000, 0x04ba6b80, 0x15710000) 
  4.   from space 34944K,   0% used [0x15710000, 0x15710000, 0x17930000) 
  5.   to   space 34944K,   0% used [0x17930000, 0x17930000, 0x19b50000) 
  6.  tenured generation   total 699072K, used 48833K [0x19b50000, 0x44600000, 0x44600000) 
  7.    the space 699072K,   6% used [0x19b50000, 0x1cb005f0, 0x1cb00600, 0x44600000) 
  8.  compacting perm gen  total 86272K, used 86136K [0x44600000, 0x49a40000, 0x64600000) 
  9.    the space 86272K,  99% used [0x44600000, 0x49a1e2f8, 0x49a1e400, 0x49a40000) 
  10. No shared spaces configured. 

日志显示perm gen空间不够,转换xslt确实需要load大量DLL文件,网络上最多的解决方案就是增加JVM参数MaxPermSize值:

 
  1. -XX:MaxPermSize=512M 

按照这个方法逐渐加大几次值后还是一直crash,而且发现一个有趣的现象:

 
  1. compacting perm gen  total 86272K, 

这个值一直没有变化,为什么?heap足够大的情况下,JVM还没有来得及增加perm gen就挂了?于是增加JVM参数直接初始化:

 
  1. -XX:PermSize=512M 

结果问题解决,看来这可能是JVM的bug,有空测测JRE7。

 
  1. vm_info: Java HotSpot(TM) Client VM (20.4-b02) for windows-x86 JRE (1.6.0_29-b11), 
  2. built on Oct  3 2011 01:01:08 by "java_re" with MS VC++ 7.1 (VS2003) 
本文转自sarchitect 51CTO博客,原文链接:http://blog.51cto.com/stevex/1113493 ,如需转载请自行联系原作者


相关文章
|
9天前
|
JavaScript 前端开发
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 内存溢出问题
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 内存溢出问题
14 1
运行JProfiler:ERROR: Invalid license key. Aborting
运行JProfiler:ERROR: Invalid license key. Aborting
371 0
运行JProfiler:ERROR: Invalid license key. Aborting
|
9月前
stack around xxx is corrupted解决方法
stack around xxx is corrupted解决方法
|
10月前
|
存储 缓存 算法
JVM虚拟机:内存区域详解(Eden Space、Survivor Space、Old Gen、Code Cache和Perm Gen)
JVM虚拟机:内存区域详解(Eden Space、Survivor Space、Old Gen、Code Cache和Perm Gen)
418 0
|
Java 编译器 应用服务中间件
Unsupported major.minor version 52.0(unable to load class com.xxxxxxx.xxx.xx.xx)
Unsupported major.minor version 52.0(unable to load class com.xxxxxxx.xxx.xx.xx)
117 0
Unsupported major.minor version 52.0(unable to load class com.xxxxxxx.xxx.xx.xx)
|
Java Maven Windows
maven内存不足:Unexpected error occurred: Not enough memory to allocate buffers for rehashing Java heap
maven内存不足:Unexpected error occurred: Not enough memory to allocate buffers for rehashing Java heap
125 0
runtime: goroutine stack exceeds 1000000000-byte limit fatal error: stack overflow
runtime: goroutine stack exceeds 1000000000-byte limit fatal error: stack overflow
232 0
|
消息中间件 Java Kafka
Kafka Windows运行错误: Native memory allocation (mmap) failed to map 1073741824 bytes for Failed to comm
Kafka Windows运行错误: Native memory allocation (mmap) failed to map 1073741824 bytes for Failed to comm
600 0