简体   繁体   English

内存不足,无法运行Java Runtime环境

[英]Insufficient memory to run Java Runtime environment to continue

I have a system with 4 GB of RAM with Windows OS. 我有一个带有4 GB RAM的Windows OS系统。 I installed VMWare to set up Ubuntu Virtual machine with 2GB RAM. 我安装了VMWare,以设置具有2GB RAM的Ubuntu虚拟机。 In Ubuntu, I opened Eclipse and started coding and Eclipse started closing again and again and I started getting the following error: 在Ubuntu中,我打开Eclipse并开始编码,而Eclipse一次又一次关闭,并且开始出现以下错误:

 There is insufficient memory for the Java Runtime Environment to continue.     Native memory allocation (mmap) failed to map 28311552 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_linux.cpp:2640), pid=4608, tid=0x6dc6eb40

 JRE version: Java(TM) SE Runtime Environment (8.0_161-b12) (build 1.8.0_161-b12)
 Java VM: Java HotSpot(TM) Client VM (25.161-b12 mixed mode linux-x86 )
 Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again


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

Current thread (0x099ab400):  VMThread [stack: 0x6dbee000,0x6dc6f000] [id=4629]

Stack: [0x6dbee000,0x6dc6f000],  sp=0x6dc6d240,  free space=508k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x5bffaf]  VMError::report_and_die()+0x16f
V  [libjvm.so+0x20e115]  report_vm_out_of_memory(char const*, int, unsigned int, VMErrorType, char const*)+0x55
V  [libjvm.so+0x4a2686]  os::Linux::commit_memory_impl(char*, unsigned int, bool)+0xe6
V  [libjvm.so+0x4a2afd]  os::pd_commit_memory_or_exit(char*, unsigned int, unsigned int, bool, char const*)+0x2d
V  [libjvm.so+0x49c660]  os::commit_memory_or_exit(char*, unsigned int, unsigned int, bool, char const*)+0x30
V  [libjvm.so+0x2741ad]  G1PageBasedVirtualSpace::commit_internal(unsigned int, unsigned int)+0x9d
V  [libjvm.so+0x27440c]  G1PageBasedVirtualSpace::commit(unsigned int, unsigned int)+0xfc
V  [libjvm.so+0x276a68]  G1RegionsLargerThanCommitSizeMapper::commit_regions(unsigned int, unsigned int)+0x28
V  [libjvm.so+0x2bc2ba]  HeapRegionManager::commit_regions(unsigned int, unsigned int)+0x5a
V  [libjvm.so+0x2bd343]  HeapRegionManager::make_regions_available(unsigned int, unsigned int)+0x23
V  [libjvm.so+0x2bd851]  HeapRegionManager::expand_by(unsigned int)+0xa1
V  [libjvm.so+0x250a7c]  G1CollectedHeap::expand(unsigned int)+0x11c
V  [libjvm.so+0x25b3fa]  G1CollectedHeap::do_collection_pause_at_safepoint(double)+0xd5a
V  [libjvm.so+0x5cbafe]  VM_G1IncCollectionPause::doit()+0x6e
V  [libjvm.so+0x5caad7]  VM_Operation::evaluate()+0x47
V  [libjvm.so+0x5c8ba3]  VMThread::evaluate_operation(VM_Operation*)+0xb3
V  [libjvm.so+0x5c8f40]  VMThread::loop()+0x1b0
V  [libjvm.so+0x5c93a5]  VMThread::run()+0x85
V  [libjvm.so+0x4a5219]  java_start(Thread*)+0x119
C  [libpthread.so.0+0x6295]  start_thread+0xe5

VM_Operation (0xbfbfede0): G1IncCollectionPause, mode: safepoint, requested by thread 0x0988f800

--------------  P R O C E S S  ---------------

The Java virtual machine process runs out of memory . Java虚拟机进程的内存不足

There are several possibilities what you could do. 有几种可能的方法。 In my view, the following possibilities are the most promising if you want to keep the current restrictions for the process: 我认为,如果您想保留该流程的当前限制,以下可能性是最有前途的:

  • Decrease Java heap size ( -Xmx / -Xms ): 减小 Java堆大小( -Xmx / -Xms ):
    In eclipse.ini there is probably a line like -Xmx1024m that you could replace with for example -Xmx640m . eclipse.ini ,可能存在类似于-Xmx1024m的行,您可以将其替换为-Xmx640m Try out which maximum heap space is still sufficient for your needs. 尝试哪个最大堆空间仍然足以满足您的需求。 Make sure -Xms is not greater than -Xmx . 确保-Xms不大于-Xmx
  • If and only if you have a 64-bit system, you can use Eclipse 64-bit and Eclipse OpenJ9 instead of Eclipse 32-bit and the Java HotSpot 32-bit VM you are currently using. 当且仅当您有64位系统时,才可以使用Eclipse 64位和Eclipse OpenJ9代替当前使用 Eclipse 32位和Java HotSpot 32位VM By default, OpenJ9 is more efficient in terms of memory consumption and can also be further tuned in this respect. 默认情况下,OpenJ9在内存消耗方面更为高效,并且在这方面也可以进行进一步调整。

The possibility Use 64 bit Java on a 64 bit OS seems to be given improperly here, because a 64-bit Java VM can address more memory, but is less memory efficient than the equivalent 32-bit VM. 此处似乎未正确给出Use 64 bit Java on a 64 bit OS的可能性,因为64位Java VM可以寻址更多内存,但与等效的32位VM相比,内存效率较低。

You have too little memory available to eclipse. 您的可用内存太少了。 Best is to upgrade your system with more ram. 最好是用更多的内存来升级您的系统。

Unless you have good reason not to then use eclipse directly under windows without using virtual box. 除非您有充分的理由不直接在Windows下使用eclipse,而不使用虚拟框。 If you must use Ubuntu consider using a 32-bit version of Ubuntu and Java and eclipse, or install Ubuntu next to windows so you can boot into it and have all your memory. 如果必须使用Ubuntu,请考虑使用32位版本的Ubuntu和Java和eclipse,或将Ubuntu安装在Windows旁边,以便启动它并拥有所有的内存。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Java 运行时环境的内存不足,无法继续 - insufficient memory for the Java Runtime Environment to continue 没有足够的内存让Java Runtime Environment继续运行 - There is insufficient memory for the Java Runtime Environment to continue Cloudera内存不足,无法继续Java Runtime Environment - Cloudera insufficient memory for the Java Runtime Environment to continue 卓:内存不足,Java Runtime Environment无法继续 - AWS: There is insufficient memory for the Java Runtime Environment to continue Java Runtime Environment 内存不足,无法继续hbase - There is insufficient memory for the Java Runtime Environment to continue hbase kafka 8 和内存 - Java 运行时环境的内存不足,无法继续 - kafka 8 and memory - There is insufficient memory for the Java Runtime Environment to continue 运行Hadoop:内存不足,无法继续Java Runtime Environment - Running Hadoop: insufficient memory for the Java Runtime Environment to continue YARN上的Spark流-没有足够的内存供Java运行时环境继续 - Spark Streaming on YARN - There is insufficient memory for the Java Runtime Environment to continue Tomcat崩溃:Java Runtime Environment没有足够的内存来继续 - Tomcat crash: There is insufficient memory for the Java Runtime Environment to continue JBoss 和 Eclipse 错误:ZD52387880E2D213817A7 的 memory 运行时环境不足 - JBoss and Eclipse error : Insufficient memory for the Java Runtime Environment to continue
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM