首页 > 解决方案 > 在 linux 服务器中运行 spring-boot 应用程序生成 gcinfo 日志

问题描述

在 linux 机器上运行 spring boot jar 总是会给出一个错误日志,上面写着 gcinfo,输出如下。

Java HotSpot(TM) 64-Bit Server VM (25.51-b03) for linux-amd64 JRE (1.8.0_51-b16), built on Jun  8 2015 19:28:07 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)
Memory: 4k page, physical 98840040k(29491820k free), swap 12287996k(11747796k free)
CommandLine flags: -XX:BaseFootPrintEstimate=2147483648 -XX:+BindGCTaskThreadsToCPUs -XX:InitialHeapSize=2147483648 -XX:+ManagementServer -XX:MaxHeapSize=2147483648 -XX:MaxNewSize=805306368 -XX:NewSize=805306368 -XX:OldPLABSize=8192 -XX:+PrintGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:-ResizeTLAB -XX:-ScavengeBeforeFullGC -XX:TLABSize=262144 -XX:ThresholdTolerance=100 -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseParallelGC -XX:YoungPLABSize=262144 
Heap
 PSYoungGen      total 688128K, used 4101K [0x00000000d0000000, 0x0000000100000000, 0x0000000100000000)
  eden space 589824K, 0% used [0x00000000d0000000,0x00000000d04014e0,0x00000000f4000000)
  from space 98304K, 0% used [0x00000000fa000000,0x00000000fa000000,0x0000000100000000)
  to   space 98304K, 0% used [0x00000000f4000000,0x00000000f4000000,0x00000000fa000000)
 ParOldGen       total 1310720K, used 0K [0x0000000080000000, 0x00000000d0000000, 0x00000000d0000000)
  object space 1310720K, 0% used [0x0000000080000000,0x0000000080000000,0x00000000d0000000)
 Metaspace       used 6863K, capacity 6902K, committed 7040K, reserved 1056768K
  class space    used 823K, capacity 847K, committed 896K, reserved 1048576K

在上面的日志中可以看到初始堆大小和最大堆大小相同,是不是因为这个?,它立即停止说意外关闭挂钩JVM错误。是不是因为其他进程占用了大量内存,任何有助于查看统计信息的命令都会很有用

标签: garbage-collectionjvmheap-memoryspring-boot-actuator

解决方案


推荐阅读