当eden空间为100%时,JVM会崩溃

时间:2021-01-20 15:28:35

I have a production system with a JBoss application server running on JDK 1.6.0_24, JBoss 4.3. Every now and then, the server crashes and a dump file created by the JVM has consistent results:

我有一个生产系统,在JDK 1.6.0_24 JBoss 4.3上运行JBoss应用服务器。有时,服务器崩溃,JVM创建的转储文件具有一致的结果:

{Heap before GC invocations=6421 (full 4675):
  PSYoungGen      total 521536K, used 518784K [0xdbc00000, 0xfbc00000, 0xfbc00000)
  eden space 518784K, 100% used [0xdbc00000,0xfb6a0000,0xfb6a0000)

  from space 2752K, 0% used [0xfb950000,0xfb950000,0xfbc00000)
  to   space 2752K, 0% used [0xfb6a0000,0xfb6a0000,0xfb950000)

 PSOldGen        total 1572864K, used 1572855K [0x7bc00000, 0xdbc00000, 0xdbc00000)
  object space 1572864K, 99% used [0x7bc00000,0xdbbfdeb8,0xdbc00000)
 PSPermGen       total 524288K, used 92683K [0x5bc00000, 0x7bc00000, 0x7bc00000)
  object space 524288K, 17% used [0x5bc00000,0x61682c30,0x7bc00000)
81507.318: [Full GC [PSYoungGen: 518784K->518784K(521536K)] [PSOldGen: 1572855K->1572855K(1572864K)] 2091639K->2091639K(2094400K) [PSPermGen: 92683K->92683K(524288K)], 1.5334976 secs] [Times: user=1.53 sys=0.00, real=1.53 secs] 
Heap after GC invocations=6421 (full 4675):
 PSYoungGen      total 521536K, used 518784K [0xdbc00000, 0xfbc00000, 0xfbc00000)
  eden space 518784K, 100% used [0xdbc00000,0xfb6a0000,0xfb6a0000)
  from space 2752K, 0% used [0xfb950000,0xfb950000,0xfbc00000)
  to   space 2752K, 0% used [0xfb6a0000,0xfb6a0000,0xfb950000)
 PSOldGen        total 1572864K, used 1572855K [0x7bc00000, 0xdbc00000, 0xdbc00000)
  object space 1572864K, 99% used [0x7bc00000,0xdbbfdeb8,0xdbc00000)
 PSPermGen       total 524288K, used 92683K [0x5bc00000, 0x7bc00000, 0x7bc00000)
  object space 524288K, 17% used [0x5bc00000,0x61682c30,0x7bc00000)
}

for JAVA_OPTS, we've got:

JAVA_OPTS等,我们有:

-server

-服务器

-Xms2048m

-Xms2048m

-Xmx2048m

-Xmx2048m

-Dsun.rmi.dgc.client.gcInterval=3600000

-Dsun.rmi.dgc.client.gcInterval = 3600000

-Dsun.rmi.dgc.server.gcInterval=3600000

-Dsun.rmi.dgc.server.gcInterval = 3600000

-Dsun.lang.ClassLoader.allowArraySyntax=true

-Dsun.lang.ClassLoader.allowArraySyntax = true

-XX:NewSize=512m

- xx:NewSize = 512

-XX:MaxNewSize=512m

- xx:MaxNewSize = 512

-XX:PermSize=512m

- xx:PermSize = 512

-XX:MaxPermSize=512m

- xx:MaxPermSize = 512

-verbosegc

详细的垃圾收集

-XX:+PrintGCDetails

- xx:+ PrintGCDetails

-XX:+PrintGCTimeStamps

- xx:+ PrintGCTimeStamps

-XX:+PrintHeapAtGC

- xx:+ PrintHeapAtGC

-XX:+CMSPermGenSweepingEnabled

- xx:+ CMSPermGenSweepingEnabled

-XX:-TraceClassLoading

- xx:-TraceClassLoading

-XX:-TraceClassUnloading

- xx:-TraceClassUnloading

So it seems to me like 2GB are enough and there is more memory that can be used, so there shouldn't be any problem.

所以在我看来,2GB就足够了,有更多的内存可以使用,所以不会有任何问题。

any suggestions?

有什么建议吗?

2 个解决方案

#1


2  

You run out of memory. You set the heap size to 2G and the young generation is 500M and old generation is 1500M filling the max 2G it can use (your survivor space is empty but low, they probably too low to get any object from Eden space.

内存用完了。您将堆大小设置为2G,年轻的一代为500米,老的一代为1500米,以填充它可以使用的最大2G(您的幸存者空间是空的,但是很低,它们可能太低,无法从Eden空间获得任何对象。

You should try to increase maximum heap size, if you still have issue you will need to monitor your memory usage to check if you don't have any leaks or some process requesting too much new object while the memory usage is already high.

您应该尝试增加最大的堆大小,如果您仍然有问题的话,您需要监视您的内存使用情况,以检查您是否没有任何泄漏或某些进程请求过多的新对象,而内存使用量已经很高。

#2


0  

Increase your Xmx value. There's nowhere for the eden space objects to spill-over into with the OldGen at ~100%.

增加你的Xmx价值。伊甸园空间的物体没有任何地方可以以100%的速度穿越到古奇根。

Consider using something like JConsole to attach to the offending application's PID and monitor the JVM memory usage. This will help to determine if certain interactions with JBoss are causing the heap to go belly up or if it's a slow memory leak.

考虑使用JConsole之类的方法附加到违规应用程序的PID并监视JVM内存使用情况。这将有助于确定与JBoss的某些交互是否导致堆崩溃,或者它是一个缓慢的内存泄漏。

#1


2  

You run out of memory. You set the heap size to 2G and the young generation is 500M and old generation is 1500M filling the max 2G it can use (your survivor space is empty but low, they probably too low to get any object from Eden space.

内存用完了。您将堆大小设置为2G,年轻的一代为500米,老的一代为1500米,以填充它可以使用的最大2G(您的幸存者空间是空的,但是很低,它们可能太低,无法从Eden空间获得任何对象。

You should try to increase maximum heap size, if you still have issue you will need to monitor your memory usage to check if you don't have any leaks or some process requesting too much new object while the memory usage is already high.

您应该尝试增加最大的堆大小,如果您仍然有问题的话,您需要监视您的内存使用情况,以检查您是否没有任何泄漏或某些进程请求过多的新对象,而内存使用量已经很高。

#2


0  

Increase your Xmx value. There's nowhere for the eden space objects to spill-over into with the OldGen at ~100%.

增加你的Xmx价值。伊甸园空间的物体没有任何地方可以以100%的速度穿越到古奇根。

Consider using something like JConsole to attach to the offending application's PID and monitor the JVM memory usage. This will help to determine if certain interactions with JBoss are causing the heap to go belly up or if it's a slow memory leak.

考虑使用JConsole之类的方法附加到违规应用程序的PID并监视JVM内存使用情况。这将有助于确定与JBoss的某些交互是否导致堆崩溃,或者它是一个缓慢的内存泄漏。