性能问答>JVM内存不足导致应用僵死>
2回复
4年前

JVM内存不足导致应用僵死



看情况怀疑是内存不足导致应用僵死,想问问大佬们为什么会僵死,而不是直接抛内存溢出(OutOfMemory)异常?为什么CPU会100%呢?

在服务器上执行Top命令

  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND
 2299 root      20   0 2621076 727936  16544 S 99.9 38.6  67:08.05 java

看到CPU100% 都是mongo 查询和插入的操作 没有计算密集型的操作 怎么会CPU100%呢

jstack看到的几乎都是BLOCKED状态

Thread 21304: (state = BLOCKED)
查看 jmap -heap 2299

Heap Usage:
New Generation (Eden + 1 Survivor Space):
   capacity = 144703488 (138.0MB)
   used     = 132853872 (126.69932556152344MB)
   free     = 11849616 (11.300674438476562MB)
   91.81110547936481% used
Eden Space:
   capacity = 128647168 (122.6875MB)
   used     = 128647168 (122.6875MB)
   free     = 0 (0.0MB)
   100.0% used
From Space:
   capacity = 16056320 (15.3125MB)
   used     = 4206704 (4.0118255615234375MB)
   free     = 11849616 (11.300674438476562MB)
   26.199677136479593% used
To Space:
   capacity = 16056320 (15.3125MB)
   used     = 0 (0.0MB)
   free     = 16056320 (15.3125MB)
   0.0% used
tenured generation:
   capacity = 321585152 (306.6875MB)
   used     = 244174704 (232.86314392089844MB)
   free     = 77410448 (73.82435607910156MB)
   75.92847570275882% used
2975 阅读
请先登录,查看2条精彩评论吧
快去登录吧,你将获得
  • 浏览更多精彩评论
  • 和开发者讨论交流,共同进步