简体   繁体   English

尽管RAM显示6 GB可用空间,但Java Runtime Environment的内存不足

[英]insufficient memory for the Java Runtime Environment to continue though RAM is showing 6 GB free space

While running java application I'm getting the following memory dump. 在运行java应用程序时,我得到以下内存转储。

After installing java 8(with java 7 application was working before) I started getting the below error. 安装java 8后(java 7应用程序之前正在运行)我开始收到以下错误。

I'm using 16 GB RAM and in task manager when I checked (while application was starting)around 6 GB RAM was free. 我正在使用16 GB RAM,在我检查时(在应用程序启动时)任务管理器中,大约6 GB RAM是免费的。

Could some one please help what could be the issue? 有人可以帮助解决问题吗?

#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 472736 bytes for Chunk::new
# 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 (allocation.cpp:390), pid=1104, tid=0x00000000000016ec
#
# JRE version: Java(TM) SE Runtime Environment (8.0_92-b14) (build 1.8.0_92-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.92-b14 mixed mode windows-amd64 compressed oops)
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#

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

---------------------------------------------------

Java Threads: ( => current thread )
  0x00000000232a8800 JavaThread "AWSessionMonitor Thread" daemon [_thread_blocked, id=14084, stack(0x0000000022b20000,0x0000000022c20000)]
  0x0000000028728800 JavaThread "Thread-3" [_thread_blocked, id=11332, stack(0x00000000210b0000,0x00000000211b0000)]
  0x00000000252a4800 JavaThread "Thread-2" [_thread_blocked, id=5272, stack(0x0000000020fb0000,0x00000000210b0000)]
  0x000000001e874000 JavaThread "SQLStatementMonitor" [_thread_blocked, id=1876, stack(0x0000000022620000,0x0000000022720000)]
  0x000000001de0d800 JavaThread "Thread-1" daemon [_thread_blocked, id=13052, stack(0x0000000022520000,0x0000000022620000)]
  0x000000001f7f8000 JavaThread "Session Timeout Thread" daemon [_thread_blocked, id=11088, stack(0x0000000022220000,0x0000000022320000)]
  0x0000000002c11800 JavaThread "DestroyJavaVM" [_thread_blocked, id=14168, stack(0x0000000002a00000,0x0000000002b00000)]
  0x000000001f32b800 JavaThread "Thread-0" [_thread_in_vm, id=10720, stack(0x0000000020bc0000,0x0000000020cc0000)]
  0x000000001fb3e800 JavaThread "Perf_Log_Traceplan-" daemon [_thread_blocked, id=2992, stack(0x0000000020ac0000,0x0000000020bc0000)]
  0x0000000020319800 JavaThread "Perf_Log_Traceperf-" daemon [_thread_blocked, id=6176, stack(0x00000000209c0000,0x0000000020ac0000)]
  0x000000001da8b000 JavaThread "Service Thread" daemon [_thread_blocked, id=9968, stack(0x000000001e020000,0x000000001e120000)]
  0x000000001da64000 JavaThread "C1 CompilerThread2" daemon [_thread_blocked, id=12708, stack(0x000000001df20000,0x000000001e020000)]
  0x000000001c13e000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=10652, stack(0x000000001de20000,0x000000001df20000)]
=>0x000000001c128000 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=5868, stack(0x000000001d920000,0x000000001da20000)]
  0x000000001c118000 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=12444, stack(0x000000001d820000,0x000000001d920000)]
  0x000000001c10c000 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_native, id=2640, stack(0x000000001d720000,0x000000001d820000)]
  0x000000001c100800 JavaThread "Attach Listener" daemon [_thread_blocked, id=9952, stack(0x000000001d620000,0x000000001d720000)]
  0x000000001c0ff800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=13880, stack(0x000000001d520000,0x000000001d620000)]
  0x000000001c0e6000 JavaThread "Finalizer" daemon [_thread_blocked, id=7868, stack(0x000000001d340000,0x000000001d440000)]
  0x000000001c0bd000 JavaThread "Reference Handler" daemon [_thread_blocked, id=11580, stack(0x000000001d240000,0x000000001d340000)]

Other Threads:
  0x000000001c0b3800 VMThread [stack: 0x000000001d140000,0x000000001d240000] [id=12984]
  0x000000001db42800 WatcherThread [stack: 0x000000001e120000,0x000000001e220000] [id=9136]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap:
 PSYoungGen      total 524800K, used 42318K [0x000000076c580000, 0x000000078cf80000, 0x00000007c0000000)
  eden space 515584K, 8% used [0x000000076c580000,0x000000076eed3b10,0x000000078bd00000)
  from space 9216K, 0% used [0x000000078bd00000,0x000000078bd00000,0x000000078c600000)
  to   space 8704K, 0% used [0x000000078c600000,0x000000078c600000,0x000000078ce80000)
 ParOldGen       total 99328K, used 24647K [0x00000006c5000000, 0x00000006cb100000, 0x000000076c580000)
  object space 99328K, 24% used [0x00000006c5000000,0x00000006c6811d80,0x00000006cb100000)
 Metaspace       used 22833K, capacity 23012K, committed 23344K, reserved 1071104K
  class space    used 2715K, capacity 2786K, committed 2864K, reserved 1048576K

Card table byte_map: [0x00000000120c0000,0x00000000128a0000] byte_map_base: 0x000000000ea98000

Marking Bits: (ParMarkBitMap*) 0x0000000069bf64f0
 Begin Bits: [0x00000000131e0000, 0x00000000170a0000)
 End Bits:   [0x00000000170a0000, 0x000000001af60000)

Polling page: 0x00000000024b0000

CodeCache: size=245760Kb used=11544Kb max_used=11559Kb free=234215Kb
 bounds [0x0000000002d00000, 0x0000000003860000, 0x0000000011d00000]
 total_blobs=2659 nmethods=2233 adapters=346
 compilation: enabled

Compilation events (10 events):
Event: 191.393 Thread 0x000000001da64000 2532       3       org.apache.xerces.util.XMLAttributesImpl::checkDuplicatesNS (278 bytes)
Event: 191.393 Thread 0x000000001c13e000 2535       4       org.apache.xerces.impl.XMLEntityScanner::scanQName (510 bytes)
Event: 191.394 Thread 0x000000001da64000 nmethod 2532 0x0000000003825d10 code [0x0000000003825f60, 0x0000000003826d38]
Event: 191.394 Thread 0x000000001da64000 2530       3       org.apache.xerces.impl.xs.opti.SchemaDOM::emptyElement (23 bytes)
Event: 191.394 Thread 0x000000001da64000 nmethod 2530 0x00000000037d66d0 code [0x00000000037d6840, 0x00000000037d6a98]
Event: 191.394 Thread 0x000000001da64000 2533       3       org.apache.xerces.impl.xs.opti.SchemaDOM::startElement (29 bytes)
Event: 191.395 Thread 0x000000001da64000 nmethod 2533 0x00000000037fb4d0 code [0x00000000037fb640, 0x00000000037fb8b8]
Event: 191.395 Thread 0x000000001da64000 2534       3       org.apache.xerces.impl.xs.opti.SchemaDOM::endElement (30 bytes)
Event: 191.395 Thread 0x000000001da64000 nmethod 2534 0x0000000003825750 code [0x00000000038258c0, 0x0000000003825b90]
Event: 191.423 Thread 0x000000001c13e000 nmethod 2535 0x000000000384fe10 code [0x0000000003850000, 0x0000000003850fe0]


---------------  S Y S T E M  ---------------

OS: Windows 8.1 , 64 bit Build 9600 (6.3.9600.17415)

CPU:total 4 (2 cores per cpu, 2 threads per core) family 6 model 58 stepping 9, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, aes, clmul, erms, ht, tsc, tscinvbit, tscinv

Memory: 4k page, physical 16442864k(1810952k free), swap 19025808k(6260k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (25.92-b14) for windows-amd64 JRE (1.8.0_92-b14), built on Mar 31 2016 21:03:04 by "java_re" with MS VC++ 10.0 (VS2010)

time: Mon May 23 12:38:20 2016
elapsed time: 191 seconds (0d 0h 3m 11s)

Java, by default, does not uses all avalaible memory. 默认情况下,Java不使用所有可用内存。 You need to run the application with the corresponding parameters. 您需要使用相应的参数运行应用程序。

See this question to all the details. 请参阅此问题以获取所有详细信息。 (It can change with the version of Java). (它可以随Java版本而改变)。

The parameter setting can be set on the command line but if you use an application you may have some configuration file. 可以在命令行上设置参数设置,但如果使用应用程序,则可能有一些配置文件。 For example, in Eclipse you have eclipse.ini where you an set your memory preferences. 例如,在Eclipse中,您可以使用eclipse.ini设置内存首选项。

有些程序使用大量内存,如Elasticsearch,如果使用这种内存密集型程序,请尝试添加更多内存

I was getting the similar memory dumps while running the same java application on Windows 10 and 8.1(both 64 bit). 我在Windows 10和8.1(均为64位)上运行相同的Java应用程序时获得了类似的内存转储。

Windows 8.1 Windows 8.1

32GB RAM 32GB RAM

i7-4790 3.60GHz CPU i7-4790 3.60GHz CPU

Paging file size(fixed, 14GB) 分页文件大小(固定,14GB)

Windows 10 Windows 10

16GB RAM 16GB RAM

i7-4790 3.60GHz CPU i7-4790 3.60GHz CPU

Paging file size(automatically managed, initially was fixed, 14GB) 分页文件大小(自动管理,最初是固定的,14GB)

1st issue was that with identical hardware(the difference in RAM only and OS), application on Windwos 10 was crashing almost instantly. 第一个问题是,使用相同的硬件(仅RAM和操作系统的差异),Windwos 10上的应用程序几乎立即崩溃。 The most surprising thing, that in Task manager I saw that only 25% of RAM is used. 最令人惊讶的是,在任务管理器中,我看到只使用了25%的RAM。

After searching info in google, I've found that: 在谷歌搜索信息后,我发现:

  1. I need to set automatically managed paging file for Windows 10. 我需要为Windows 10设置自动管理的页面文件。
  2. Windows 10 is more greedy with committed memory than previous versions of windows . 与以前版本的Windows相比,Windows 10提交的内存更加贪婪

2nd issue 第二期

As was mentioned by @borjab 正如@borjab所提到的那样

Java, by default, does not uses all available memory. 默认情况下,Java不使用所有可用内存。

To get a help on non-standard options for Java type in your CMD: 要获得有关CMD中Java类型的非标准选项的帮助,请执行以下操作:

java -X

Output: 输出:

-Xms<size>        set initial Java heap size
-Xmx<size>        set maximum Java heap size

<size> can be defined in <size>可以在中定义

G - Gigabytes  
M - Megabytes  
K - Kilobytes

The final solution for both OS was: 两种操作系统的最终解决方案是:

java -Xmx15G -Xms15G -jar selenium-server-standalone-3.4.0.jar

My initial java version 我最初的java版本

java version "1.8.0_91" java版“1.8.0_91”

Java(TM) SE Runtime Environment (build 1.8.0_91-b14) Java(TM)SE运行时环境(版本1.8.0_91-b14)

Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode) Java HotSpot(TM)64位服务器VM(内置25.91-b14,混合模式)

Updated java version 更新了java版本

java version "1.8.0_152" java版“1.8.0_152”

Java(TM) SE Runtime Environment (build 1.8.0_152-b16) Java(TM)SE运行时环境(版本1.8.0_152-b16)

Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode) Java HotSpot(TM)64位服务器VM(内置25.152-b16,混合模式)

Your application, by default, does not use all the available system memory (or RAM). 默认情况下,您的应用程序不使用所有可用的系统内存(或RAM)。 The limit depends on the xmx value you have set. 限制取决于您设置的xmx值。

Not sure if 64 bit is an option for you, if it is, this lets you increase your xmx more than the 32 bit version. 不确定64位是否是您的选项,如果是,这可以让您比32位版本增加xmx。

声明:本站的技术帖子网页,遵循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环境 - Insufficient memory to run 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
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM