gpt4 book ai didi

java - native 内存分配 (mmap) 映射失败

转载 作者:塔克拉玛干 更新时间:2023-11-03 03:46:11 26 4
gpt4 key购买 nike

我开始面临 native 内存分配问题。我想可能与 -Xmx 和 -Xms 设置有关。设置此值的推荐方法是什么?

目前我有:-Xmx13G -Xms6G

我读到建议设置相同的值,但没有解释原因。

我得到的错误是:

    # There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 746061824 bytes for committing reserved memory.
# Possible reasons:
# The system is out of physical RAM or swap space
# In 32 bit mode, the process size limit was hit
# 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.cpp:2627), pid=13528, tid=0x00007f2b0b5f5700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_101-b13) (build 1.8.0_101-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.101-b13 mixed mode linux-amd64 compressed oops)
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#

/proc/meminfo:
MemTotal: 16433112 kB
MemFree: 166336 kB
Buffers: 114324 kB
Cached: 398396 kB
SwapCached: 0 kB
Active: 15151496 kB
Inactive: 254348 kB
Active(anon): 14893020 kB
Inactive(anon): 604 kB
Active(file): 258476 kB
Inactive(file): 253744 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 12 kB
Writeback: 0 kB
AnonPages: 14892976 kB
Mapped: 24024 kB
Shmem: 696 kB
Slab: 349384 kB
SReclaimable: 187700 kB
SUnreclaim: 161684 kB
KernelStack: 43520 kB
PageTables: 276768 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 8216556 kB
Committed_AS: 33089080 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 31404 kB
VmallocChunk: 34359652884 kB
HardwareCorrupted: 0 kB
AnonHugePages: 13486080 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 28672 kB
DirectMap2M: 16879616 kB

Memory: 4k page, physical 16433112k(166336k free), swap 0k(0k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (25.101-b13) for linux-amd64 JRE (1.8.0_101-b13), built on Jun 22 2016 02:59:44 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)

最佳答案

您显然要求的远远超过您系统上实际可用的数量。您总共有 16GB,但已使用 90%,并且您没有任何交换空间,因此您无法获得 -Xms6G,更不用说更多 (-Xmx13G).

您需要找出哪些其他进程正在使用内存,例如 top 并按驻留内存排序(大写字母 O,然后是 q),并在运行 JVM 之前停止足够的它们以释放至少 6GB。

那个,或者将你的物理内存加倍到 32GB,或者添加 16GB 的交换空间(但如果系统负载过重,这可能会导致抖动)。

关于java - native 内存分配 (mmap) 映射失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48592602/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com