我的操作系统版本是 Windows 7 64 位,JDK 是 32 位版本。我成功地启动了我的 JBoss Wrapper 应用程序,但是在它运行了一段时间之后,JVM 失败并重新启动。
JVM 转储日志中的消息是:
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 543672 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.
#
# Out of Memory Error (allocation.cpp:328), pid=5480, tid=4740
#
# JRE version: 7.0_05-b05
# Java VM: Java HotSpot(TM) Server VM (23.1-b03 mixed mode windows-x86 )
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
我在我的计算机上部署了 3 个包装应用程序。它们中的每一个都设置为 700Mb 的最大 JVM 堆大小。
请帮我回顾一下这个问题。谢谢。我的问题是:
- 我如何知道当前 JVM 分配的大小?
- 这个问题的原因是什么?
- 如何解决?有人推荐我使用 64 位 JDK。有必要吗?