本机内存分配(mmap)Map12288字节以提交保留内存失败

yyyllmsg  于 2021-06-30  发布在  Java
关注(0)|答案(0)|浏览(585)

我们正在用jvm8版本运行tomcat9。我们将最小堆设置为2gb,最大为7gb。但是我们经常看到本机内存分配(mmap)失败的错误。堆配置看起来像: "-Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Xms2048M -Xmx7168M -XX:MaxPermSize=512M" 我能看出在失败之前有足够的堆那么它为什么失败。我们的系统vm.max\u map\u count

  1. sysctl vm.max_map_count
  2. vm.max_map_count = 65530

免费-总共使用了免费共享buff/cache可用内存:52187 19653 452 40 32082 32012交换:4095 80 4015。
我观察到os vm.max\u map也在不断增加,通常在linux上默认大小是65k左右。昨天是8k(tomcat重启时),现在增加到25k

  1. pmap 46012|wc -l
  2. 33410
  3. # There is insufficient memory for the Java Runtime Environment to continue.
  4. # Native memory allocation (mmap) failed to map 12288 bytes for committing reserved memory.
  5. # Possible reasons:
  6. # The system is out of physical RAM or swap space
  7. # In 32 bit mode, the process size limit was hit
  8. # Possible solutions:
  9. # Reduce memory load on the system
  10. # Increase physical memory or swap space
  11. # Check if swap backing store is full
  12. # Use 64 bit Java on a 64 bit OS
  13. # Decrease Java heap size (-Xmx/-Xms)
  14. # Decrease number of Java threads
  15. # Decrease Java thread stack sizes (-Xss)
  16. # Set larger code cache with -XX:ReservedCodeCacheSize=
  17. # This output file may be truncated or incomplete.
  18. #
  19. # Out of Memory Error (os_linux.cpp:2627), pid=51706, tid=0x00007f403bbbf700
  20. #
  21. # JRE version: Java(TM) SE Runtime Environment (8.0_102-b14) (build 1.8.0_102-b14)
  22. # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.102-b14 mixed mode linux-amd64 compressed oops)
  23. # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
  24. #
  25. --------------- T H R E A D ---------------
  26. Current thread (0x00007f48d9131800): JavaThread "CBONLINE-DBAdapter-DB-Pool connection closer" daemon [_thread_new, id=68713, stack(0x00007f403babf000,0x00007f403bbc0000)]
  27. Stack: [0x00007f403babf000,0x00007f403bbc0000], sp=0x00007f403bbbe9a0, free space=1022k
  28. Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
  29. V [libjvm.so+0xac52aa] VMError::report_and_die()+0x2ba
  30. V [libjvm.so+0x4fc29b] report_vm_out_of_memory(char const*, int, unsigned long, VMErrorType, char const*)+0x8b
  31. V [libjvm.so+0x922603] os::Linux::commit_memory_impl(char*, unsigned long, bool)+0x103
  32. V [libjvm.so+0x9226cc] os::pd_commit_memory(char*, unsigned long, bool)+0xc
  33. V [libjvm.so+0x91c17a] os::commit_memory(char*, unsigned long, bool)+0x2a
  34. V [libjvm.so+0x92089f] os::pd_create_stack_guard_pages(char*, unsigned long)+0x7f
  35. V [libjvm.so+0xa6a55e] JavaThread::create_stack_guard_pages()+0x5e
  36. V [libjvm.so+0xa73d44] JavaThread::run()+0x34
  37. V [libjvm.so+0x9249c8] java_start(Thread*)+0x108
  38. C [libpthread.so.0+0x7ea5] start_thread+0xc5
  39. --------------- P R O C E S S ---------------
  40. Java Threads: ( => current thread )
  41. 0x00007f48d9132800 JavaThread "DBAdapter-DB-Pool connection adder" daemon [_thread_new, id=68714, stack(0x00007f4035156000,0x00007f4035257000)]
  42. =>0x00007f48d9131800 JavaThread "DBAdapter-DB-Pool connection closer" daemon [_thread_new, id=68713, stack(0x00007f403babf000,0x00007f403bbc0000)]
  43. 0x00007f4914add000 JavaThread "AS40
  44. OS:Oracle Linux Server release 7.9
  45. uname:Linux 3.10.0-1160.2.2.el7.x86_64 #1 SMP Thu Oct 22 09:10:02 PDT 2020 x86_64
  46. libc:glibc 2.17 NPTL 2.17
  47. rlimit: STACK 8192k, CORE 0k, NPROC 160274, NOFILE 65535, AS infinity
  48. load average:4.07 5.27 5.04
  49. /proc/meminfo:
  50. MemTotal: 41053988 kB
  51. MemFree: 353240 kB
  52. MemAvailable: 18211824 kB
  53. Buffers: 0 kB
  54. Cached: 17371124 kB
  55. SwapCached: 30176 kB
  56. Active: 27419984 kB
  57. Inactive: 9387136 kB
  58. Active(anon): 17764840 kB
  59. Inactive(anon): 1767940 kB
  60. Active(file): 9655144 kB
  61. Inactive(file): 7619196 kB
  62. Unevictable: 12380 kB
  63. Mlocked: 12380 kB
  64. SwapTotal: 4194300 kB
  65. SwapFree: 3862524 kB
  66. Dirty: 18944 kB
  67. Writeback: 0 kB
  68. AnonPages: 19420940 kB
  69. Mapped: 76264 kB
  70. Shmem: 85784 kB
  71. Slab: 1544296 kB
  72. SReclaimable: 1019240 kB
  73. SUnreclaim: 525056 kB
  74. KernelStack: 757520 kB
  75. PageTables: 138316 kB
  76. NFS_Unstable: 0 kB
  77. Bounce: 0 kB
  78. WritebackTmp: 0 kB
  79. CommitLimit: 24721292 kB
  80. Committed_AS: 65627724 kB
  81. VmallocTotal: 34359738367 kB
  82. VmallocUsed: 296108 kB
  83. VmallocChunk: 34359310332 kB
  84. Percpu: 28672 kB
  85. HardwareCorrupted: 0 kB
  86. AnonHugePages: 12632064 kB
  87. CmaTotal: 0 kB
  88. CmaFree: 0 kB
  89. HugePages_Total: 0
  90. HugePages_Free: 0
  91. HugePages_Rsvd: 0
  92. HugePages_Surp: 0
  93. Hugepagesize: 2048 kB
  94. DirectMap4k: 341824 kB
  95. DirectMap2M: 8046592 kB
  96. DirectMap1G: 35651584 kB

解决这个问题的闲置解决方案是什么?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题