java hs_err 路径_tomcat启动的时候,报这个错,在bin目录下的hs_err_pid7752.log

#

# There is insufficient memory for the Java Runtime Environment to continue.

# Native memory allocation (malloc) failed to allocate 1048576 bytes for AllocateHeap

# 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 (memory/allocation.inline.hpp:61), pid=7752, tid=4676

#

# JRE version:  (7.0_79-b15) (build )

# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.79-b02 mixed mode windows-amd64 compressed oops)

# Failed to write core dump. Call to MiniDumpWriteDump() failed

#

---------------  T H R E A D  ---------------

Current thread (0x0000000002501000):  JavaThread "Unknown thread" [_thread_in_vm, id=4676, stack(0x0000000002920000,0x0000000002a20000)]

Stack: [0x0000000002920000,0x0000000002a20000]

[error occurred during error reporting (printing stack bounds), id 0xc0000005]

看提示是说分配 1048576 字节的

Native 内存

时失败了. native 内存不足, 不代表 JVM 的堆内存不足, 因为 native 内存是由 C 语言中的

malloc

所分配的, 它不包含在堆内存中. 出现 native 分配失败的情况, 一般就是因为整个操作系统的物理内存不足了, 导致没有多余的内存空间分配给 native 内存.

而上面的错误提示也给出了解决方法:

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)

其中提到了三点关键的:

减少堆内存(-Xmx/-Xms);

减少 Java 线程数.

减少 Java 的线程堆栈大小(-Xss).

为什么这样做呢? 因为 native 内存不在 Heap 中, 因此 JVM 所占用的实际内存由:

native 内存 + Heap 内存 + 栈内存 + 其他

, 因此减少 Heap 内存, 那么可用的 native 内存就提高了.

1048576 bytes

这是

1Mb

吧。只给堆分配这么点内存吗?

看样子是内存不足导致的

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值