本机内存分配(mmap)无法映射用于提交保留内存的字节

时间:2017-06-01 13:53:52

标签: java linux memory memory-management out-of-memory

我正在AWS t2.micro实例&amp;中运行下载服务器我已配置512 MB的最大堆和&amp;我的java进程的最小堆为256 MB。我在单个线程中执行迁移类型的过程,从谷歌驱动器下载文件(大小<50MB)。但是当我运行它时,我收到以下错误

error='Cannot allocate memory' (errno=12) # # There is insufficient memory for the Java Runtime Environment to continue. # Native memory allocation (mmap) failed to map 33558528 bytes for committing reserved memory.

以下是hs_err_pid13942.log

的摘录

VM参数:

jvm_args: -Xms256m -Xmx512m -XX:PermSize=32m -XX:MaxPermSize=64m -XX:+HeapDumpOnOutOfMemoryError

这是我的meminfo

/proc/meminfo:
MemTotal:        1016324 kB
MemFree:           58792 kB
Buffers:             344 kB
Cached:            15984 kB
SwapCached:            0 kB
Active:           899232 kB
Inactive:          14664 kB
Active(anon):     897692 kB
Inactive(anon):      332 kB
Active(file):       1540 kB
Inactive(file):    14332 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                72 kB
Writeback:             0 kB
AnonPages:        897608 kB
Mapped:             6284 kB
Shmem:               416 kB
Slab:              22276 kB
SReclaimable:      10960 kB
SUnreclaim:        11316 kB
KernelStack:        1408 kB
PageTables:         7460 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:      508160 kB
Committed_AS:     881084 kB
VmallocTotal:   34359738367 kB
VmallocUsed:        4664 kB
VmallocChunk:   34359727628 kB
HardwareCorrupted:     0 kB
AnonHugePages:    591872 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       28672 kB
DirectMap2M:     1150976 kB

这是cpu信息

/proc/cpuinfo:
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 63
model name      : Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz
stepping        : 2
microcode       : 0x25
cpu MHz         : 2394.552
cache size      : 30720 KB
physical id     : 0
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm xsaveopt fsgsbase bmi1 avx2 smep bmi2 erms invpcid
bogomips        : 4789.10
clflush size    : 64
cache_alignment : 64
address sizes   : 46 bits physical, 48 bits virtual
power management:

Memory: 4k page, physical 1016324k(58792k free), swap 0k(0k free)

我可以看到58 MB免费&amp;我也看到了足够的内存空间,同时使用&#39; free -h&#39;实例中的命令。所以我不明白为什么这个错误首先发生。有人可以向我解释原因吗?还有什么我在做内存配置时做错了什么?

0 个答案:

没有答案