今天Idea授权码到期了,想着先用eclipse撑两天。结果打开直接闪退了。
直接上日志
# # There is insufficient memory for the Java Runtime Environment to continue. # Native memory allocation (malloc) failed to allocate 1391216 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=23716, tid=19972 # # JRE version: Java(TM) SE Runtime Environment (8.0_74-b02) (build 1.8.0_74-b02) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.74-b02 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 --------------- Current thread (0x0000000022236800): JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=19972, stack(0x00000000232f0000,0x00000000233f0000)] Stack: [0x00000000232f0000,0x00000000233f0000] [error occurred during error reporting (printing stack bounds), id 0xc0000005] Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) Current CompileTask: C2: 61629 12232 4 org.eclipse.jdt.internal.core.JarPackageFragmentRoot::initRawPackageInfo (349 bytes) --------------- P R O C E S S --------------- Java Threads: ( => current thread ) 0x000000000ac29000 JavaThread "org.eclipse.jdt.internal.ui.text.JavaReconciler" daemon [_thread_in_native_trans, id=15732, stack(0x00000000015e0000,0x00000000016e0000)] 0x000000000ac24000 JavaThread "ForkJoinPool.commonPool-worker-1" daemon [_thread_blocked, id=12616, stack(0x0000000030f70000,0x0000000031070000)] 0x000000000ac1b000 JavaThread "Java indexing" daemon [_thread_blocked, id=22492, stack(0x000000002e950000,0x000000002ea50000)] 0x0000000024b9b000 JavaThread "Bundle File Closer" daemon [_thread_blocked, id=23360, stack(0x000000002c8a0000,0x000000002c9a0000)] 0x0000000024b9d800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=22408, stack(0x000000002b640000,0x000000002b740000)] 0x0000000024b99000 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=24040, stack(0x0000000028ff0000,0x00000000290f0000)] 0x0000000024b9c800 JavaThread "Gogo shell" [_thread_blocked, id=12520, stack(0x0000000027ce0000,0x0000000027de0000)] 0x0000000024b9c000 JavaThread "EMF Reference Cleaner" daemon [_thread_blocked, id=5408, stack(0x0000000026910000,0x0000000026a10000)] 0x0000000024b96800 JavaThread "Worker-1" [_thread_blocked, id=21044, stack(0x0000000026610000,0x0000000026710000)] 0x0000000024b98000 JavaThread "Worker-0" [_thread_blocked, id=3788, stack(0x0000000026510000,0x0000000026610000)] 0x0000000024b9a800 JavaThread "Worker-JM" [_thread_blocked, id=22244, stack(0x0000000026210000,0x0000000026310000)] 0x0000000024224800 JavaThread "SCR Component Actor" daemon [_thread_blocked, id=22724, stack(0x0000000025e10000,0x0000000025f10000)] 0x0000000024aac800 JavaThread "Start Level: Equinox Container: 1cadd026-7580-4587-b949-7f443f34af44" daemon [_thread_blocked, id=9116, stack(0x0000000025d10000,0x0000000025e10000)] 0x0000000024aac000 JavaThread "Framework Event Dispatcher: Equinox Container: 1cadd026-7580-4587-b949-7f443f34af44" daemon [_thread_blocked, id=20972, stack(0x0000000006240000,0x0000000006340000)] 0x000000002496f000 JavaThread "Active Thread: Equinox Container: 1cadd026-7580-4587-b949-7f443f34af44" [_thread_blocked, id=15384, stack(0x0000000009c90000,0x0000000009d90000)] 0x0000000022206000 JavaThread "Service Thread" daemon [_thread_blocked, id=21348, stack(0x0000000023df0000,0x0000000023ef0000)] 0x000000002219c000 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=17844, stack(0x00000000234f0000,0x00000000235f0000)] 0x000000002219b800 JavaThread "C2 CompilerThread2" daemon [_thread_in_native, id=23416, stack(0x00000000233f0000,0x00000000234f0000)] =>0x0000000022236800 JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=19972, stack(0x00000000232f0000,0x00000000233f0000)] 0x0000000022199000 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=24432, stack(0x00000000231f0000,0x00000000232f0000)] 0x0000000022152800 JavaThread "Attach Listener" daemon [_thread_blocked, id=18112, stack(0x00000000230f0000,0x00000000231f0000)] 0x0000000022151800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=24428, stack(0x0000000022ff0000,0x00000000230f0000)] 0x0000000022151000 JavaThread "Surrogate Locker Thread (Concurrent GC)" daemon [_thread_blocked, id=13676, stack(0x0000000022ef0000,0x0000000022ff0000)] 0x00000000220d5000 JavaThread "Finalizer" daemon [_thread_blocked, id=24376, stack(0x0000000022df0000,0x0000000022ef0000)] 0x00000000220cf000 JavaThread "Reference Handler" daemon [_thread_blocked, id=24060, stack(0x0000000022cf0000,0x0000000022df0000)] 0x000000000931e000 JavaThread "main" [_thread_in_native, id=20592, stack(0x0000000001200000,0x0000000001300000)] Other Threads: 0x00000000220a3800 VMThread [stack: 0x0000000022bf0000,0x0000000022cf0000] [id=20728] 0x000000002222c800 WatcherThread [stack: 0x0000000023ef0000,0x0000000023ff0000] [id=13656] VM state:not at safepoint (normal execution) VM Mutex/Monitor currently owned by a thread: None Heap: garbage-first heap total 262144K, used 220775K [0x00000000d0000000, 0x00000000d0100800, 0x0000000100000000) region size 1024K, 84 young (86016K), 2 survivors (2048K) Metaspace used 97835K, capacity 108422K, committed 108492K, reserved 1142784K class space used 11815K, capacity 14757K, committed 14796K, reserved 1048576K CodeCache: size=245760Kb used=36523Kb max_used=36561Kb free=209236Kb bounds [0x0000000010470000, 0x0000000012860000, 0x000000001f470000] total_blobs=10493 nmethods=9518 adapters=883 compilation: enabled Compilation events (10 events): Event: 61.604 Thread 0x000000002219c000 12240 3 org.eclipse.jdt.internal.compiler.util.Util::isClassFileName (82 bytes) Event: 61.604 Thread 0x000000002219c000 nmethod 12240 0x0000000011046d10 code [0x0000000011046ec0, 0x0000000011047568] Event: 61.604 Thread 0x000000002219c000 12239 ! 3 org.eclipse.jdt.internal.core.JavaModelManager::getArchiveValidity (77 bytes) Event: 61.605 Thread 0x000000002219c000 nmethod 12239 0x0000000011046090 code [0x0000000011046260, 0x0000000011046998] Event: 61.606 Thread 0x000000002219c000 12241 3 org.eclipse.jdt.internal.compiler.util.Util::getInputStreamAsByteArray (138 bytes) Event: 61.606 Thread 0x000000002219c000 nmethod 12241 0x000000001186cf90 code [0x000000001186d180, 0x000000001186dc88] Event: 61.617 Thread 0x000000002219c000 12244 3 org.eclipse.jdt.internal.core.util.HashSetOfArray::
很是奇怪, -Xmx设置的是768m,系统还有6G左右的空闲内存。应该不会存在内存不足的问题。根据日志提示的“Possible solutions”都没能解决问题。知道看到最后SYSTEM这段信息提示了swap交换分区只有大约8M了,初步判断是这里的问题。
Windows操作系统的swap就是虚拟内存,于是我抱着试试的心态去调整下虚拟内存。
我的是win11c操作系统,操作步骤如下:
1、进入“设置”,选择“系统”分类,再选型“系统信息”。
2、点击“高级系统设置”。
3、在弹出的界面选择“高级”选项,点击性能分组的“设置”。