- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我搜索并看到了一些主题,但没有一个能解决我遇到的具体问题。
我正在尝试使用 Runtime.getRuntime().freeMemory()
、Runtime.getRuntime().maxMemory()
和 来监控我的内存使用情况Runtime.getRuntime().totalMemory()
.
在一次运行中,它说在声明一个数组之前有 2245273792 个空闲字节,但是程序在尝试声明一个 1104674816 字节的数组时内存不足并崩溃:
Free memory (bytes): 2245273792
Maximum memory (bytes): 6710886400
Total memory available to JVM (bytes): 5606211584
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000728280000, 1104674816, 0) failed; error='Cannot allocate memory' (errno=12)
There is insufficient memory for the Java Runtime Environment to continue.
Native memory allocation (malloc) failed to allocate 1104674816 bytes for committing reserved memory.
An error report file with more information is saved as:
编辑:当它分配的内存量少于可用量的一半时,它怎么可能用完内存?内存不足对这个程序来说是非常糟糕的;有什么办法可以保证我分配的资源不会超过可用资源?首先调用 System.gc() 会使空闲/可用内存量更可靠吗?如果程序即将耗尽内存,我可以抛出某种异常,而不是让它崩溃吗?
它崩溃的命令是:float[][] A = new float[NUM_SEQ_TOTAL_P1][NUM_SEQ_TOTAL_P2];
with NUM_SEQ_TOTAL_P1 = 16009, NUM_SEQ_TOTAL_P2 = 16937。
编辑:根据评论者的要求粘贴在下面的错误日志部分。
There is insufficient memory for the Java Runtime Environment to continue.
Native memory allocation (malloc) failed to allocate 1104674816 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:2769), pid=14802, tid=140058464728832
JRE version: OpenJDK Runtime Environment (7.0_55-b14) (build 1.7.0_55-b14)
Java VM: OpenJDK 64-Bit Server VM (24.51-b03 mixed mode linux-amd64 compressed oops)
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 (0x00007f61f0071000): VMThread [stack: 0x00007f61e6f9b000,0x00007f61e709c000] [id=14806]
Stack: [0x00007f61e6f9b000,0x00007f61e709c000], sp=0x00007f61e709a470, free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x917b35] VMError::report_and_die()+0x175
V [libjvm.so+0x468144] report_vm_out_of_memory(char const*, int, unsigned long, char const*)+0x74
V [libjvm.so+0x79a81b] os::pd_commit_memory(char*, unsigned long, unsigned long, bool)+0x20b
V [libjvm.so+0x7950df] os::commit_memory(char*, unsigned long, unsigned long, bool)+0x1f
V [libjvm.so+0x8053cb] PSVirtualSpace::expand_by(unsigned long)+0x5b
V [libjvm.so+0x7f519b] PSOldGen::expand_by(unsigned long) [clone .part.80]+0x1b
V [libjvm.so+0x7f535b] PSOldGen::expand(unsigned long) [clone .part.81]+0xdb
V [libjvm.so+0x7f6288] PSOldGen::resize(unsigned long)+0x188
V [libjvm.so+0x7fd2e3] PSParallelCompact::invoke_no_policy(bool)+0x9c3
V [libjvm.so+0x80350d] PSScavenge::invoke()+0x17d
V [libjvm.so+0x7b9b33] ParallelScavengeHeap::failed_mem_allocate(unsigned long)+0x63
V [libjvm.so+0x919544] VM_ParallelGCFailedAllocation::doit()+0x84
V [libjvm.so+0x91d9e7] VM_Operation::evaluate()+0x47
V [libjvm.so+0x91c3b8] VMThread::evaluate_operation(VM_Operation*)+0x318
V [libjvm.so+0x91c85a] VMThread::loop()+0x25a
V [libjvm.so+0x91cc62] VMThread::run()+0x72
V [libjvm.so+0x7974e2] java_start(Thread*)+0xf2
VM_Operation (0x00007f61f8b6b2e0): ParallelGCFailedAllocation, mode: safepoint, requested by thread 0x00007f61f000a000
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x00007f61f00a1800 JavaThread "Service Thread" daemon [_thread_blocked, id=14812, stack(0x00007f61e680c000,0x00007f61e690d000)]
0x00007f61f009f000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=14811, stack(0x00007f61e690d000,0x00007f61e6a0e000)]
0x00007f61f009c000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=14810, stack(0x00007f61e6a0e000,0x00007f61e6b0f000)]
0x00007f61f009a000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=14809, stack(0x00007f61e6b0f000,0x00007f61e6c10000)]
0x00007f61f0077800 JavaThread "Finalizer" daemon [_thread_blocked, id=14808, stack(0x00007f61e6d99000,0x00007f61e6e9a000)]
0x00007f61f0075800 JavaThread "Reference Handler" daemon [_thread_blocked, id=14807, stack(0x00007f61e6e9a000,0x00007f61e6f9b000)]
0x00007f61f000a000 JavaThread "main" [_thread_blocked, id=14803, stack(0x00007f61f8a6c000,0x00007f61f8b6d000)]
Other Threads:
=>0x00007f61f0071000 VMThread [stack: 0x00007f61e6f9b000,0x00007f61e709c000] [id=14806]
0x00007f61f00ac000 WatcherThread [stack: 0x00007f61e670b000,0x00007f61e680c000] [id=14813]
VM state:at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event])
[0x00007f61f0005ea0] ExpandHeap_lock - owner thread: 0x00007f61f0071000
[0x00007f61f0006520] Threads_lock - owner thread: 0x00007f61f0071000
[0x00007f61f0006a20] Heap_lock - owner thread: 0x00007f61f000a000
Heap
PSYoungGen total 1638400K, used 205885K [0x000000076a000000, 0x0000000800000000, 0x0000000800000000)
eden space 819200K, 0% used [0x000000076a000000,0x000000076a000000,0x000000079c000000)
from space 819200K, 25% used [0x00000007ce000000,0x00000007da90f408,0x0000000800000000)
to space 819200K, 0% used [0x000000079c000000,0x000000079c000000,0x00000007ce000000)
ParOldGen total 3836416K, used 3836085K [0x000000063e000000, 0x0000000728280000, 0x000000076a000000)
object space 3836416K, 99% used [0x000000063e000000,0x000000072822d6b8,0x0000000728280000)
PSPermGen total 21504K, used 5549K [0x0000000633a00000, 0x0000000634f00000, 0x000000063e000000)
object space 21504K, 25% used [0x0000000633a00000,0x0000000633f6b518,0x0000000634f00000)
Card table byte_map: [0x00007f61f487d000,0x00007f61f56e1000] byte_map_base: 0x00007f61f16e0000
Polling page: 0x00007f61f8b7d000
Code Cache [0x00007f61ed000000, 0x00007f61ed270000, 0x00007f61f0000000)
total_blobs=653 nmethods=373 adapters=234 free_code_cache=46884Kb largest_free_block=47925312
Compilation events (10 events):
Event: 697.652 Thread 0x00007f61f009c000 394 playingAgent.tartanian7.PlayerAction::access$0 (5 bytes)
Event: 697.652 Thread 0x00007f61f009c000 nmethod 394 0x00007f61ed1f0150 code [0x00007f61ed1f0280, 0x00007f61ed1f02d8]
Event: 729.745 Thread 0x00007f61f009f000 395 java.nio.Buffer::remaining (10 bytes)
Event: 729.745 Thread 0x00007f61f009f000 nmethod 395 0x00007f61ed1eff50 code [0x00007f61ed1f0080, 0x00007f61ed1f00d8]
Event: 921.702 Thread 0x00007f61f009c000 396 playingAgent.riverSolver.DoylesGameRiver2::getRiverStrategy (451 bytes)
Event: 921.710 Thread 0x00007f61f009f000 397 playingAgent.tartanian7.PokerUtils::countRoundDelimiters (42 bytes)
Event: 921.714 Thread 0x00007f61f009f000 nmethod 397 0x00007f61ed1f8350 code [0x00007f61ed1f84a0, 0x00007f61ed1f86b8]
Event: 921.720 Thread 0x00007f61f009f000 398 java.lang.String::startsWith (7 bytes)
Event: 921.724 Thread 0x00007f61f009f000 nmethod 398 0x00007f61ed108010 code [0x00007f61ed108160, 0x00007f61ed108338]
Event: 922.063 Thread 0x00007f61f009c000 nmethod 396 0x00007f61ed23db90 code [0x00007f61ed23e6e0, 0x00007f61ed244d78]
GC Heap History (10 events):
Event: 922.966 GC heap after
Heap after GC invocations=137 (full 23):
PSYoungGen total 1638400K, used 280234K [0x000000076a000000, 0x0000000800000000, 0x0000000800000000)
eden space 819200K, 0% used [0x000000076a000000,0x000000076a000000,0x000000079c000000)
from space 819200K, 34% used [0x00000007ce000000,0x00000007df1aa930,0x0000000800000000)
to space 819200K, 0% used [0x000000079c000000,0x000000079c000000,0x00000007ce000000)
ParOldGen total 3836416K, used 2558981K [0x000000063e000000, 0x0000000728280000, 0x000000076a000000)
object space 3836416K, 66% used [0x000000063e000000,0x00000006da301608,0x0000000728280000)
PSPermGen total 21504K, used 5548K [0x0000000633a00000, 0x0000000634f00000, 0x000000063e000000)
object space 21504K, 25% used [0x0000000633a00000,0x0000000633f6b068,0x0000000634f00000)
}
Event: 941.023 GC heap before
{Heap before GC invocations=138 (full 23):
PSYoungGen total 1638400K, used 1099434K [0x000000076a000000, 0x0000000800000000, 0x0000000800000000)
eden space 819200K, 100% used [0x000000076a000000,0x000000079c000000,0x000000079c000000)
from space 819200K, 34% used [0x00000007ce000000,0x00000007df1aa930,0x0000000800000000)
to space 819200K, 0% used [0x000000079c000000,0x000000079c000000,0x00000007ce000000)
ParOldGen total 3836416K, used 2558981K [0x000000063e000000, 0x0000000728280000, 0x000000076a000000)
object space 3836416K, 66% used [0x000000063e000000,0x00000006da301608,0x0000000728280000)
PSPermGen total 21504K, used 5548K [0x0000000633a00000, 0x0000000634f00000, 0x000000063e000000)
object space 21504K, 25% used [0x0000000633a00000,0x0000000633f6b258,0x0000000634f00000)
Event: 941.125 GC heap after
Heap after GC invocations=138 (full 23):
PSYoungGen total 1638400K, used 463312K [0x000000076a000000, 0x0000000800000000, 0x0000000800000000)
eden space 819200K, 0% used [0x000000076a000000,0x000000076a000000,0x000000079c000000)
from space 819200K, 56% used [0x000000079c000000,0x00000007b8474158,0x00000007ce000000)
to space 819200K, 0% used [0x00000007ce000000,0x00000007ce000000,0x0000000800000000)
ParOldGen total 3836416K, used 2559185K [0x000000063e000000, 0x0000000728280000, 0x000000076a000000)
object space 3836416K, 66% used [0x000000063e000000,0x00000006da334680,0x0000000728280000)
PSPermGen total 21504K, used 5548K [0x0000000633a00000, 0x0000000634f00000, 0x000000063e000000)
object space 21504K, 25% used [0x0000000633a00000,0x0000000633f6b258,0x0000000634f00000)
}
Event: 971.960 GC heap before
{Heap before GC invocations=139 (full 23):
PSYoungGen total 1638400K, used 1282512K [0x000000076a000000, 0x0000000800000000, 0x0000000800000000)
eden space 819200K, 100% used [0x000000076a000000,0x000000079c000000,0x000000079c000000)
from space 819200K, 56% used [0x000000079c000000,0x00000007b8474158,0x00000007ce000000)
to space 819200K, 0% used [0x00000007ce000000,0x00000007ce000000,0x0000000800000000)
ParOldGen total 3836416K, used 2559185K [0x000000063e000000, 0x0000000728280000, 0x000000076a000000)
object space 3836416K, 66% used [0x000000063e000000,0x00000006da334680,0x0000000728280000)
PSPermGen total 21504K, used 5549K [0x0000000633a00000, 0x0000000634f00000, 0x000000063e000000)
object space 21504K, 25% used [0x0000000633a00000,0x0000000633f6b518,0x0000000634f00000)
Event: 971.996 GC heap after
Heap after GC invocations=139 (full 23):
PSYoungGen total 1638400K, used 130974K [0x000000076a000000, 0x0000000800000000, 0x0000000800000000)
eden space 819200K, 0% used [0x000000076a000000,0x000000076a000000,0x000000079c000000)
from space 819200K, 15% used [0x00000007ce000000,0x00000007d5fe7b78,0x0000000800000000)
to space 819200K, 0% used [0x000000079c000000,0x000000079c000000,0x00000007ce000000)
ParOldGen total 3836416K, used 2559301K [0x000000063e000000, 0x0000000728280000, 0x000000076a000000)
object space 3836416K, 66% used [0x000000063e000000,0x00000006da351710,0x0000000728280000)
PSPermGen total 21504K, used 5549K [0x0000000633a00000, 0x0000000634f00000, 0x000000063e000000)
object space 21504K, 25% used [0x0000000633a00000,0x0000000633f6b518,0x0000000634f00000)
}
Event: 972.098 GC heap before
{Heap before GC invocations=140 (full 23):
PSYoungGen total 1638400K, used 950174K [0x000000076a000000, 0x0000000800000000, 0x0000000800000000)
eden space 819200K, 100% used [0x000000076a000000,0x000000079c000000,0x000000079c000000)
from space 819200K, 15% used [0x00000007ce000000,0x00000007d5fe7b78,0x0000000800000000)
to space 819200K, 0% used [0x000000079c000000,0x000000079c000000,0x00000007ce000000)
ParOldGen total 3836416K, used 2559301K [0x000000063e000000, 0x0000000728280000, 0x000000076a000000)
object space 3836416K, 66% used [0x000000063e000000,0x00000006da351710,0x0000000728280000)
PSPermGen total 21504K, used 5549K [0x0000000633a00000, 0x0000000634f00000, 0x000000063e000000)
object space 21504K, 25% used [0x0000000633a00000,0x0000000633f6b518,0x0000000634f00000)
Event: 972.296 GC heap after
Heap after GC invocations=140 (full 23):
PSYoungGen total 1638400K, used 817538K [0x000000076a000000, 0x0000000800000000, 0x0000000800000000)
eden space 819200K, 0% used [0x000000076a000000,0x000000076a000000,0x000000079c000000)
from space 819200K, 99% used [0x000000079c000000,0x00000007cde60b18,0x00000007ce000000)
to space 819200K, 0% used [0x00000007ce000000,0x00000007ce000000,0x0000000800000000)
ParOldGen total 3836416K, used 2689286K [0x000000063e000000, 0x0000000728280000, 0x000000076a000000)
object space 3836416K, 70% used [0x000000063e000000,0x00000006e2241b50,0x0000000728280000)
PSPermGen total 21504K, used 5549K [0x0000000633a00000, 0x0000000634f00000, 0x000000063e000000)
object space 21504K, 25% used [0x0000000633a00000,0x0000000633f6b518,0x0000000634f00000)
}
Event: 972.397 GC heap before
{Heap before GC invocations=141 (full 23):
PSYoungGen total 1638400K, used 1636738K [0x000000076a000000, 0x0000000800000000, 0x0000000800000000)
eden space 819200K, 100% used [0x000000076a000000,0x000000079c000000,0x000000079c000000)
from space 819200K, 99% used [0x000000079c000000,0x00000007cde60b18,0x00000007ce000000)
to space 819200K, 0% used [0x00000007ce000000,0x00000007ce000000,0x0000000800000000)
ParOldGen total 3836416K, used 2689286K [0x000000063e000000, 0x0000000728280000, 0x000000076a000000)
object space 3836416K, 70% used [0x000000063e000000,0x00000006e2241b50,0x0000000728280000)
PSPermGen total 21504K, used 5549K [0x0000000633a00000, 0x0000000634f00000, 0x000000063e000000)
object space 21504K, 25% used [0x0000000633a00000,0x0000000633f6b518,0x0000000634f00000)
Event: 972.791 GC heap after
Heap after GC invocations=141 (full 23):
PSYoungGen total 1638400K, used 817782K [0x000000076a000000, 0x0000000800000000, 0x0000000800000000)
eden space 819200K, 0% used [0x000000076a000000,0x000000076a000000,0x000000079c000000)
from space 819200K, 99% used [0x00000007ce000000,0x00000007ffe9d998,0x0000000800000000)
to space 819200K, 0% used [0x000000079c000000,0x000000079c000000,0x00000007ce000000)
ParOldGen total 3836416K, used 3506825K [0x000000063e000000, 0x0000000728280000, 0x000000076a000000)
object space 3836416K, 91% used [0x000000063e000000,0x00000007140a2668,0x0000000728280000)
PSPermGen total 21504K, used 5549K [0x0000000633a00000, 0x0000000634f00000, 0x000000063e000000)
object space 21504K, 25% used [0x0000000633a00000,0x0000000633f6b518,0x0000000634f00000)
}
Event: 972.791 GC heap before
{Heap before GC invocations=142 (full 24):
PSYoungGen total 1638400K, used 817782K [0x000000076a000000, 0x0000000800000000, 0x0000000800000000)
eden space 819200K, 0% used [0x000000076a000000,0x000000076a000000,0x000000079c000000)
from space 819200K, 99% used [0x00000007ce000000,0x00000007ffe9d998,0x0000000800000000)
to space 819200K, 0% used [0x000000079c000000,0x000000079c000000,0x00000007ce000000)
ParOldGen total 3836416K, used 3506825K [0x000000063e000000, 0x0000000728280000, 0x000000076a000000)
object space 3836416K, 91% used [0x000000063e000000,0x00000007140a2668,0x0000000728280000)
PSPermGen total 21504K, used 5549K [0x0000000633a00000, 0x0000000634f00000, 0x000000063e000000)
object space 21504K, 25% used [0x0000000633a00000,0x0000000633f6b518,0x0000000634f00000)
Deoptimization events (10 events):
Event: 388.757 Thread 0x00007f61f000a000 Uncommon trap: reason=array_check action=maybe_recompile pc=0x00007f61ed200cd4 method=java.util.ComparableTimSort.mergeHi(IIII)V @ 234
Event: 425.767 Thread 0x00007f61f000a000 Uncommon trap: reason=array_check action=maybe_recompile pc=0x00007f61ed226240 method=java.util.ComparableTimSort.mergeHi(IIII)V @ 642
Event: 425.768 Thread 0x00007f61f000a000 Uncommon trap: reason=array_check action=maybe_recompile pc=0x00007f61ed226240 method=java.util.ComparableTimSort.mergeHi(IIII)V @ 642
Event: 451.013 Thread 0x00007f61f000a000 Uncommon trap: reason=array_check action=maybe_recompile pc=0x00007f61ed229d20 method=java.util.ComparableTimSort.mergeHi(IIII)V @ 404
Event: 451.013 Thread 0x00007f61f000a000 Uncommon trap: reason=array_check action=maybe_recompile pc=0x00007f61ed229d20 method=java.util.ComparableTimSort.mergeHi(IIII)V @ 404
Event: 518.661 Thread 0x00007f61f000a000 Uncommon trap: reason=array_check action=maybe_recompile pc=0x00007f61ed22c5c8 method=java.util.ComparableTimSort.mergeHi(IIII)V @ 509
Event: 518.661 Thread 0x00007f61f000a000 Uncommon trap: reason=array_check action=maybe_recompile pc=0x00007f61ed22c5c8 method=java.util.ComparableTimSort.mergeHi(IIII)V @ 509
Event: 576.223 Thread 0x00007f61f000a000 Uncommon trap: reason=array_check action=maybe_recompile pc=0x00007f61ed22399c method=java.util.ComparableTimSort.mergeLo(IIII)V @ 129
Event: 626.762 Thread 0x00007f61f000a000 Uncommon trap: reason=array_check action=maybe_recompile pc=0x00007f61ed22399c method=java.util.ComparableTimSort.mergeLo(IIII)V @ 129
Event: 805.388 Thread 0x00007f61f000a000 Uncommon trap: reason=array_check action=maybe_recompile pc=0x00007f61ed232884 method=java.util.ComparableTimSort.mergeHi(IIII)V @ 160
Internal exceptions (10 events):
Event: 95.779 Thread 0x00007f61f000a000 Threw 0x000000076e72f270 at /build/buildd/openjdk-7-7u55-2.4.7/build/openjdk/hotspot/src/share/vm/prims/jvm.cpp:1244
Event: 95.780 Thread 0x00007f61f000a000 Threw 0x000000076e732680 at /build/buildd/openjdk-7-7u55-2.4.7/build/openjdk/hotspot/src/share/vm/prims/jvm.cpp:1244
Event: 95.866 Thread 0x00007f61f000a000 Threw 0x000000076ea384b0 at /build/buildd/openjdk-7-7u55-2.4.7/build/openjdk/hotspot/src/share/vm/prims/jvm.cpp:1244
Event: 118.330 Thread 0x00007f61f000a000 Threw 0x0000000770f9b6f0 at /build/buildd/openjdk-7-7u55-2.4.7/build/openjdk/hotspot/src/share/vm/prims/jvm.cpp:1244
Event: 118.332 Thread 0x00007f61f000a000 Threw 0x0000000770fba0d8 at /build/buildd/openjdk-7-7u55-2.4.7/build/openjdk/hotspot/src/share/vm/prims/jvm.cpp:1244
Event: 118.528 Thread 0x00007f61f000a000 Threw 0x00000007713a1fc0 at /build/buildd/openjdk-7-7u55-2.4.7/build/openjdk/hotspot/src/share/vm/prims/jvm.cpp:1244
Event: 118.529 Thread 0x00007f61f000a000 Threw 0x00000007713a9628 at /build/buildd/openjdk-7-7u55-2.4.7/build/openjdk/hotspot/src/share/vm/prims/jvm.cpp:1244
Event: 118.533 Thread 0x00007f61f000a000 Threw 0x00000007713bea90 at /build/buildd/openjdk-7-7u55-2.4.7/build/openjdk/hotspot/src/share/vm/prims/jvm.cpp:1244
Event: 118.545 Thread 0x00007f61f000a000 Threw 0x00000007713e8238 at /build/buildd/openjdk-7-7u55-2.4.7/build/openjdk/hotspot/src/share/vm/prims/jvm.cpp:1244
Event: 118.546 Thread 0x00007f61f000a000 Threw 0x00000007713eb0f8 at /build/buildd/openjdk-7-7u55-2.4.7/build/openjdk/hotspot/src/share/vm/prims/jvm.cpp:1244
Events (10 events):
Event: 972.069 Executing VM operation: RevokeBias done
Event: 972.069 Executing VM operation: RevokeBias
Event: 972.069 Executing VM operation: RevokeBias done
Event: 972.069 Executing VM operation: RevokeBias
Event: 972.069 Executing VM operation: RevokeBias done
Event: 972.069 Executing VM operation: RevokeBias
Event: 972.069 Executing VM operation: RevokeBias done
Event: 972.069 Executing VM operation: RevokeBias
Event: 972.296 Executing VM operation: RevokeBias done
Event: 972.296 Executing VM operation: RevokeBias
Dynamic libraries:[omitted]
VM Arguments:
jvm_args: -Xmx7200m
java_command: [omitted]
Launcher Type: SUN_STANDARD
Environment Variables: [omitted]
Signal Handlers:
SIGSEGV: [libjvm.so+0x918620], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGBUS: [libjvm.so+0x918620], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGFPE: [libjvm.so+0x795e30], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGPIPE: [libjvm.so+0x795e30], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGXFSZ: [libjvm.so+0x795e30], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGILL: [libjvm.so+0x795e30], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGUSR2: [libjvm.so+0x795cd0], sa_mask[0]=0x00000000, sa_flags=0x10000004
SIGHUP: [libjvm.so+0x795eb0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGINT: [libjvm.so+0x795eb0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGTERM: [libjvm.so+0x795eb0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGQUIT: [libjvm.so+0x795eb0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
--------------- S Y S T E M ---------------
OS:Ubuntu 14.04 (trusty)
uname:Linux 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
libc:glibc 2.19 NPTL 2.19
rlimit: STACK 8192k, CORE 0k, NPROC 59937, NOFILE 4096, AS infinity
load average:1.80 1.67 1.50
/proc/meminfo:
MemTotal: 7693824 kB
MemFree: 634168 kB
Buffers: 12600 kB
Cached: 290332 kB
SwapCached: 0 kB
Active: 6799656 kB
Inactive: 151160 kB
Active(anon): 6647936 kB
Inactive(anon): 200 kB
Active(file): 151720 kB
Inactive(file): 150960 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 36 kB
Writeback: 0 kB
AnonPages: 6647924 kB
Mapped: 18848 kB
Shmem: 236 kB
Slab: 41348 kB
SReclaimable: 32536 kB
SUnreclaim: 8812 kB
KernelStack: 848 kB
PageTables: 17104 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 3846912 kB
Committed_AS: 6744548 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 14888 kB
VmallocChunk: 34359719127 kB
HardwareCorrupted: 0 kB
AnonHugePages: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 7872512 kB
DirectMap2M: 0 kB
CPU:total 2 (16 cores per cpu, 2 threads per core) family 6 model 62 stepping 4, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, aes, erms, ht, tsc
/proc/cpuinfo:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 62
model name : Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
stepping : 4
microcode : 0x415
cpu MHz : 2500.058
cache size : 25600 KB
physical id : 1
siblings : 2
core id : 0
cpu cores : 1
apicid : 32
initial apicid : 32
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu de tsc msr pae cx8 apic sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt tsc_deadline_timer aes rdrand hypervisor lahf_lm ida arat epb pln pts dtherm fsgsbase erms
bogomips : 5000.11
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 62
model name : Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
stepping : 4
microcode : 0x415
cpu MHz : 2500.058
cache size : 25600 KB
physical id : 1
siblings : 2
core id : 0
cpu cores : 1
apicid : 32
initial apicid : 32
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu de tsc msr pae cx8 apic sep cmov pat clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt tsc_deadline_timer aes rdrand hypervisor lahf_lm ida arat epb pln pts dtherm fsgsbase erms
bogomips : 5000.11
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
Memory: 4k page, physical 7693824k(634168k free), swap 0k(0k free)
vm_info: OpenJDK 64-Bit Server VM (24.51-b03) for linux-amd64 JRE (1.7.0_55-b14), built on Apr 17 2014 20:08:07 by "buildd" with gcc 4.8.2
time: Thu May 29 20:30:58 2014
elapsed time: 979 seconds
最佳答案
由于运行时报告 2.245gig 免费,并在需要 1.104gig 时报告失败,因此请求应该成功是合乎逻辑的。但是当您需要 1.104gig 时,您确实需要一个连续 内存块。当连续 block 不可用时,JVM 会报告 OutOfMemory 异常。
对堆碎片进行一些搜索。堆碎片是您的根本问题。
一种可能的解决方案是使用 nio 字节缓冲区和 allocateDirect。
内存分配在 JVM 堆空间之外。
来自 JavaDoc:
A direct byte buffer may be created by invoking the allocateDirect factory method of this class. The buffers returned by this method typically have somewhat higher allocation and deallocation costs than non-direct buffers. The contents of direct buffers may reside outside of the normal garbage-collected heap, and so their impact upon the memory footprint of an application might not be obvious. It is therefore recommended that direct buffers be allocated primarily for large, long-lived buffers that are subject to the underlying system's native I/O operations. In general it is best to allocate direct buffers only when they yield a measureable gain in program performance.
关于Java Runtime.getRuntime().freeMemory() 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23943122/
关闭。这个问题是off-topic .它目前不接受答案。 想要改进这个问题? Update the question所以它是on-topic用于堆栈溢出。 关闭 12 年前。 Improve thi
我有一个动态网格,其中的数据功能需要正常工作,这样我才能逐步复制网格中的数据。假设在第 5 行中,我输入 10,则从第 6 行开始的后续行应从 11 开始读取,依此类推。 如果我转到空白的第一行并输入
我有一个关于我的按钮消失的问题 我已经把一个图像作为我的按钮 用这个函数动画 function example_animate(px) { $('#cont
我有一个具有 Facebook 连接和经典用户名/密码登录的网站。目前,如果用户单击 facebook_connect 按钮,系统即可运行。但是,我想将现有帐户链接到 facebook,因为用户可以选
我有一个正在为 iOS 开发的应用程序,该应用程序执行以下操作 加载和设置注释并启动核心定位和缩放到位置。 map 上有很多注释,从数据加载不会花很长时间,但将它们实际渲染到 map 上需要一段时间。
我被推荐使用 Heroku for Ruby on Rails 托管,到目前为止,我认为我真的会喜欢它。只是想知道是否有人可以帮助我找出问题所在。 我按照那里的说明在该网站上创建应用程序,创建并提交
我看过很多关于 SSL 错误的帖子和信息,我自己也偶然发现了一个。 我正在尝试使用 GlobalSign CA BE 证书通过 Android WebView 访问网页,但出现了不可信错误。 对于大多
我想开始使用 OpenGL 3+ 和 4,但我在使用 Glew 时遇到了问题。我试图将 glew32.lib 包含在附加依赖项中,并且我已将库和 .dll 移动到主文件夹中,因此不应该有任何路径问题。
我已经盯着这两个下载页面的源代码看了一段时间,但我似乎找不到问题。 我有两个下载页面,一个 javascript 可以工作,一个没有。 工作:http://justupload.it/v/lfd7不是
我一直在使用 jQuery,只是尝试在单击链接时替换文本字段以及隐藏/显示内容项。它似乎在 IE 中工作得很好,但我似乎无法让它在 FF 中工作。 我的 jQuery: $(function() {
我正在尝试为 NDK 编译套接字库,但出现以下两个错误: error: 'close' was not declared in this scope 和 error: 'min' is not a m
我正在使用 Selenium 浏览器自动化框架测试网站。在测试过程中,我切换到特定的框架,我们将其称为“frame_1”。后来,我在 Select 类中使用了 deselectAll() 方法。不久之
我正在尝试通过 Python 创建到 Heroku PostgreSQL 数据库的连接。我将 Windows10 与 Python 3.6.8 和 PostgreSQL 9.6 一起使用。 我从“ht
我有一个包含 2 列的数据框,我想根据两列之间的比较创建第三列。 所以逻辑是:第 1 列 val = 3,第 2 列 val = 4,因此新列值什么都没有 第 1 列 val = 3,第 2 列 va
我想知道如何调试 iphone 5 中的 css 问题。 我尝试使用 firelite 插件。但是从纵向旋转到横向时,火石占据了整个屏幕。 有没有其他方法可以调试 iphone 5 中的 css 问题
所以我有点难以理解为什么这不起作用。我正在尝试替换我正在处理的示例站点上的类别复选框。我试图让它做以下事情:未选中时以一种方式出现,悬停时以另一种方式出现(选中或未选中)选中时以第三种方式出现(而不是
Javascript CSS 问题: 我正在使用一个文本框来写入一个 div。我使用以下 javascript 获取文本框来执行此操作: function process_input(){
你好,我很难理解 P、NP 和多项式时间缩减的主题。我试过在网上搜索它并问过我的一些 friend ,但我没有得到任何好的答案。 我想问一个关于这个话题的一般性问题: 设 A,B 为 P 中的语言(或
你好,我一直在研究 https://leetcode.com/problems/2-keys-keyboard/并想到了这个动态规划问题。 您从空白页上的“A”开始,完成后得到一个数字 n,页面上应该
我正在使用 Cocoapods 和 KIF 在 Xcode 服务器上运行持续集成。我已经成功地为一个项目设置了它来报告每次提交。我现在正在使用第二个项目并收到错误: Bot Issue: warnin
我是一名优秀的程序员,十分优秀!