我有一个运行在带有linux 64bit操作系统的amazon-ec2-m1.large实例上的jar文件.我在不同时间后耗尽内存,通常在2-4之间,尽管在我的上一次日志写入(在创建错误文件之前),我看到以下内容:
Memory -
totalHeapSize: 264 MB,
maxHeapSize: 1656 MB,
freeHeapSize: 220 MB
Run Code Online (Sandbox Code Playgroud)
当我从jar开始看到内存耗尽时 - 所有值都相同,freeHeapSize介于200-230 MB之间(我每隔30秒检查一次并执行System.gc())
在hs_err_pid2250.log中写:
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Cannot create GC thread. Out of system resources.
# 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 …Run Code Online (Sandbox Code Playgroud)