开发者社区> 问答> 正文

运行java程序报内存不足

服务器是centos6.5 4G内存 4Gswap  在主目录下总是产生hs_err_pid1234.log类的日志,内容如下:
#
# There is insufficient memory for the Java Runtime Environment to continue.
# pthread_getattr_np
# 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 (os_linux_x86.cpp:728), pid=20631, tid=140163717150464
#
# JRE version:  (8.0_25-b17) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.25-b02 mixed mode linux-amd64 compressed oops)

展开
收起
dengluzhyong 2015-05-11 10:10:38 9416 0
2 条回答
写回答
取消 提交回答
  • 回1楼enapsoft的帖子
    嗯,弄好了,重装了下jdk版本,由原来的1.8降到1.7  tomcat改成7.0.61现在不报内存不足了
    2015-05-17 09:58:41
    赞同 展开评论 打赏
  • Re运行java程序报内存不足
    确认你操作系统的版本,确认jre的版本,尽可能使用64位版本,32位jre版本有内存大小的限制。再查看一下你的jvm的设置,里面有最大内存的限制,可以修改的大一点
    2015-05-11 10:35:58
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载