Java 6 Update 25 VM crash:内存不足 [英] Java 6 Update 25 VM crash: insufficient memory

查看:191
本文介绍了Java 6 Update 25 VM crash:内存不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关此问题的更新,请参阅下文。

For an update of this question - see below.

我体验到对于我)jvm 崩溃不是OutOfMemoryError
(崩溃的应用程序是eclipse 3.6.2)。
但是,查看崩溃日志让我想知道:

I experience a (reproducible, at least for me) jvm crash (not an OutOfMemoryError) (The application which crashes is eclipse 3.6.2). However, looking at the crash log makes me wonder:

#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 65544 bytes for Chunk::new
# Possible reasons:
#   The system is out of physical RAM or swap space
#   In 32 bit mode, the process size limit was hit
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Use 64 bit Java on a 64 bit OS
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.

Current thread (0x531d6000):  JavaThread "C2 CompilerThread1" daemon 
[_thread_in_native, id=7812, stack(0x53af0000,0x53bf0000)]

Stack: [0x53af0000,0x53bf0000],  sp=0x53bee860,  free space=1018k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0x1484aa]
V  [jvm.dll+0x1434fc]
V  [jvm.dll+0x5e6fc]
V  [jvm.dll+0x5e993]
V  [jvm.dll+0x27a571]
V  [jvm.dll+0x258672]
V  [jvm.dll+0x25ed93]
V  [jvm.dll+0x260072]
V  [jvm.dll+0x24e59a]
V  [jvm.dll+0x47edd]
V  [jvm.dll+0x48a6f]
V  [jvm.dll+0x12dcd4]
V  [jvm.dll+0x155a0c]
C  [MSVCR71.dll+0xb381]
C  [kernel32.dll+0xb729]

我使用Windows XP 32位SP3。我有4GB的内存
在启动应用程序之前,根据任务管理器(+ 1 GB系统缓存,也可能会被释放),我有2 GB的空闲空间。我肯定有足够的可用RAM。

I am using Windows XP 32-bit SP3. I have 4GB RAM. Before starting the application I had 2 GB free according the task manager (+ 1 GB system cache which might be freed as well.). I am definitely having enough free RAM.

从开始到崩溃,我使用visualvm和jconsole记录了jvm内存统计信息。
我获取了内存消耗统计数据,直到崩溃前的最后时刻。

From the start till the crash I logged the jvm memory statistics using visualvm and jconsole. I acquired the memory consumption statistics until the last moments before the crash.

统计信息显示以下分配的内存大小:

The statistics shows the following allocated memory sizes:


  • HeapSize: 751 MB(使用248 MB)

  • Non-HeapSize(PermGen& CodeCache) : 150 MB(使用95 MB)

  • 内存管理区大小(Edenspace,Old-gen等): 350 MB

  • 线程堆栈大小: 17 MB (根据 oracle ,由于51个线程正在运行的事实)

  • HeapSize: 751 MB (used 248 MB)
  • Non-HeapSize(PermGen & CodeCache): 150 MB (used 95 MB)
  • Size of memory management areas (Edenspace, Old-gen etc.): 350 MB
  • Thread stack sizes: 17 MB (according to oracle and due the fact that 51 threads are running)

我正在运行应用程序(jre 6更新25,服务器vm)使用参数:

I am running the application (jre 6 update 25, server vm) using the parameters:

-XX:PermSize=128m
-XX:MaxPermSize=192m
-XX:ReservedCodeCacheSize=96m
-Xms500m
-Xmx1124m

问题:


  • 为什么在vm和操作系统上显然有足够的内存时,jvm崩溃?

    通过上述设置,我认为我无法达到2GB的32位限制(1124MB + 192MB + 96MB +线程堆栈& 2GB)。在任何其他情况下(堆分配太多),我宁愿预期一个OutOfMemoryError比jvm崩溃

谁可以帮助我在这里出现什么问题?

Who can help me to figure out what is going wrong here?

(注意:我最近升级到Eclipse 3.6.2从Eclipse 3.4.2,从Java 5升级到Java 6.我怀疑有由于我以前没有看到这些变化,因此崩溃与这些更改之间的联系)

(Note: I upgraded recently to Eclipse 3.6.2 from Eclipse 3.4.2 and from Java 5 to Java 6. I suspect that there's a connection between the crashes and these changes, because I haven't seen these before)

更新

似乎是一个jvm错误 Java 6 Update 25 中引入,并且与新的jit编译器有关。另见此博客条目
根据博客,这个bug的修复应该是下一个java 6更新的一部分。
同时我在崩溃时得到了本机堆栈跟踪。我已经更新了上述崩溃日志。

It seems to be a jvm bug introduced in Java 6 Update 25 and has something to do with the new jit compiler. See also this blog entry. According to the blog the fix of this bug should be part of the next java 6 update. In the meanwhile I got a native stack trace during a crash. I've updated the above crash log.

提出的解决方法,使用vm参数 -XX:-DoEscapeAnalysis 作品(至少显着降低崩溃的可能性)

The proposed workaround, using the vm argument -XX:-DoEscapeAnalysis works (at least it notably lowers the probability of a crash)

推荐答案

我在工作中偶然发现了类似的问题。我们为我们的应用程序设置了-Xmx65536M,但却不断得到完全相同的错误。有趣的是,错误总是发生在我们的应用程序实际上进行相当轻量的计算的时候,相对来说是这样的,因此无处可以接近这个限制。

I stumbled upon a similar problem at work. We had set -Xmx65536M for our application but kept getting exactly the same kind of errors. The funny thing is that the errors happened always at a time when our application was actually doing pretty lightweight calculations, relatively speaking, and was thus nowhere near this limit.

我们发现在线问题的一个可能的解决方案: http://www.blogsoncloud.com/jsp/techSols/java-lang-OutOfMemoryError-unable-to-create-new-native-thread.jsp ,它似乎解决了我们的问题。在将-Xmx降低到50G后,我们没有遇到任何问题。

We found a possible solution for the problem online: http://www.blogsoncloud.com/jsp/techSols/java-lang-OutOfMemoryError-unable-to-create-new-native-thread.jsp , and it seemed to solve our problem. After lowering -Xmx to 50G, we've had none of these issues.

在这种情况下实际发生的情况对我们来说还不太清楚。

What actually happens in the case is still somewhat unclear to us.

这篇关于Java 6 Update 25 VM crash:内存不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆