gpt4 book ai didi

java - 内存不足,Java 运行时环境无法继续

转载 作者:行者123 更新时间:2023-11-30 07:59:21 25 4
gpt4 key购买 nike

我的 Java 应用程序在 JIT 编译期间运行几天后失败。可能是 native 内存已进行碎片整理,但只需要 8Kb...我有超过 700 个线程。 2Gbs 堆(jvm 失败时仅使用 1Gb)请帮忙解决这个问题。

#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 8192 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
# 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_solaris.cpp:2677), pid=25465, tid=47
#
# JRE version: Java(TM) SE Runtime Environment (8.0_31-b13) (build 1.8.0_31-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.31-b07 mixed mode solaris-sparc compressed oops)
# Core dump written. Default location: /location/core or core.25465
#

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

Current thread (0x0000000100c75000): JavaThread "C2 CompilerThread3" daemon [_thread_in_vm, id=47, stack(0xffffffff58d00000,0xffffffff58e00000)]

Stack: [0xffffffff58d00000,0xffffffff58e00000], sp=0xffffffff58dfcfd0, free space=1011k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0xddc994] void VMError::report_and_die()+0x6e4
V [libjvm.so+0x5347d4] void report_vm_out_of_memory(const char*,int,unsigned long,VMErrorType,const char*)+0x64
V [libjvm.so+0xb7304c] int os::Solaris::commit_memory_impl(char*,unsigned long,bool)+0x10c
V [libjvm.so+0xb73334] bool os::pd_commit_memory(char*,unsigned long,unsigned long,bool)+0x2c
V [libjvm.so+0xb66354] bool os::commit_memory(char*,unsigned long,unsigned long,bool)+0x2c
V [libjvm.so+0xdd756c] bool VirtualSpace::expand_by(unsigned long,bool)+0x150
V [libjvm.so+0x684364] bool CodeHeap::expand_by(unsigned long)+0xc8
V [libjvm.so+0x492038] CodeBlob*CodeCache::allocate(int,bool)+0xa0
V [libjvm.so+0xb1e08c] nmethod*nmethod::new_nmethod(methodHandle,int,int,CodeOffsets*,int,DebugInformationRecorder*,Dependencies*,CodeBuffer*,int,OopMapSet*,ExceptionHandlerTable*,ImplicitExceptionTable*,AbstractCompiler*,int)+0x2d0
V [libjvm.so+0x3ec93c] void ciEnv::register_method(ciMethod*,int,CodeOffsets*,int,CodeBuffer*,int,OopMapSet*,ExceptionHandlerTable*,ImplicitExceptionTable*,AbstractCompiler*,int,bool,bool,RTMState)+0x524
V [libjvm.so+0x4b6c90] Compile::Compile(ciEnv*,C2Compiler*,ciMethod*,int,bool,bool,bool)+0x1380
V [libjvm.so+0x3b4898] void C2Compiler::compile_method(ciEnv*,ciMethod*,int)+0xa8
V [libjvm.so+0x4d02b8] void CompileBroker::invoke_compiler_on_method(CompileTask*)+0xeb0
V [libjvm.so+0x4cebf8] void CompileBroker::compiler_thread_loop()+0x490
V [libjvm.so+0xd2611c] void JavaThread::thread_main_inner()+0x94
V [libjvm.so+0xd26068] void JavaThread::run()+0x398
V [libjvm.so+0xb6dcb0] java_start+0x390
C [libc.so.1+0xe2464] _lwp_start+0x8

最佳答案

我不了解Solaris,但Linux有sysctl vm.max_map_count,它限制虚拟内存映射的最大数量。

因此,虽然可能有足够的可用物理内存和虚拟地址空间,但它可能会超出允许的映射数量。

关于java - 内存不足,Java 运行时环境无法继续,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32178079/

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