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

文章讨论了SpringBoot应用在运行过程中遇到的内存不足错误,原因可能是JavaHeap与Nativeheap的冲突,或是系统交换空间不足。给出了检查和解决方法,如检查物理内存、调整虚拟内存设置等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

springboot运行过程中报 There is insufficient memory for the Java Runtime Environment to continue.

错误如下:

# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 746586112 bytes for G1 virtual space
# Possible reasons:
#   The system is out of physical RAM or swap space
#   The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
#   JVM is running with Zero Based Compressed Oops mode in which the Java heap is
#     placed in the first 32GB address space. The Java Heap base address is the
#     maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress
#     to set the Java Heap base and to place the Java Heap above 32GB virtual address.
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (os_windows.cpp:3552), pid=119572, tid=46956
#
# JRE version: Java(TM) SE Runtime Environment (17.0.9+11) (build 17.0.9+11-LTS-201)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0.9+11-LTS-201, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#

在添加设置 -Xms2048m -Xmx3027m 扔无法解决问题时,考虑 The system is out of physical RAM or swap space

系统可能超出物理内存或交换空间,首先物理内存肯定没有超出,那么肯定就是交换空间超出了。什么是交换空间呢?交换空间,在Windows系统中是指虚拟内存。调整交换空间大小即设置虚拟内存大小。这样就清晰了,就是电脑的虚拟内存设的不够,于是点开我的电脑->属性->高级系统设置->高级->设置->高级里,看到虚拟内存设置是否够用

可以通过自定义设置虚拟内存大小来解决问题

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值