美文网首页
jvm垃圾收集器验证

jvm垃圾收集器验证

作者: 程序男保姆 | 来源:发表于2020-05-28 18:27 被阅读0次

java -XX:+PrintCommandLineFlags -version

-XX:InitialHeapSize=134217728 -XX:MaxHeapSize=2147483648 -XX:+PrintCommandLineFlags -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseParallelGC 
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

-verbose:gc -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+UseSerialGC

Tenured表示是 serial old在老年代进行回收。

{Heap before GC invocations=0 (full 0):
 def new generation   total 39296K, used 6896K [0x0000000740000000, 0x0000000742aa0000, 0x000000076aaa0000)
  eden space 34944K,  19% used [0x0000000740000000, 0x00000007406bc3f8, 0x0000000742220000)
  from space 4352K,   0% used [0x0000000742220000, 0x0000000742220000, 0x0000000742660000)
  to   space 4352K,   0% used [0x0000000742660000, 0x0000000742660000, 0x0000000742aa0000)
 tenured generation   total 87424K, used 0K [0x000000076aaa0000, 0x0000000770000000, 0x00000007c0000000)
   the space 87424K,   0% used [0x000000076aaa0000, 0x000000076aaa0000, 0x000000076aaa0200, 0x0000000770000000)
 Metaspace       used 3358K, capacity 4496K, committed 4864K, reserved 1056768K
  class space    used 371K, capacity 388K, committed 512K, reserved 1048576K
[Full GC (System.gc()) [Tenured: 0K->631K(87424K), 0.0054967 secs] 6896K->631K(126720K), [Metaspace: 3358K->3358K(1056768K)], 0.0059284 secs] [Times: user=0.00 sys=0.01, real=0.00 secs] 
Heap after GC invocations=1 (full 1):
 def new generation   total 39424K, used 0K [0x0000000740000000, 0x0000000742ac0000, 0x000000076aaa0000)
  eden space 35072K,   0% used [0x0000000740000000, 0x0000000740000000, 0x0000000742240000)
  from space 4352K,   0% used [0x0000000742240000, 0x0000000742240000, 0x0000000742680000)
  to   space 4352K,   0% used [0x0000000742680000, 0x0000000742680000, 0x0000000742ac0000)
 tenured generation   total 87424K, used 631K [0x000000076aaa0000, 0x0000000770000000, 0x00000007c0000000)
   the space 87424K,   0% used [0x000000076aaa0000, 0x000000076ab3dd90, 0x000000076ab3de00, 0x0000000770000000)
 Metaspace       used 3358K, capacity 4496K, committed 4864K, reserved 1056768K
  class space    used 371K, capacity 388K, committed 512K, reserved 1048576K
}
Heap
 def new generation   total 39424K, used 351K [0x0000000740000000, 0x0000000742ac0000, 0x000000076aaa0000)
  eden space 35072K,   1% used [0x0000000740000000, 0x0000000740057c58, 0x0000000742240000)
  from space 4352K,   0% used [0x0000000742240000, 0x0000000742240000, 0x0000000742680000)
  to   space 4352K,   0% used [0x0000000742680000, 0x0000000742680000, 0x0000000742ac0000)
 tenured generation   total 87424K, used 631K [0x000000076aaa0000, 0x0000000770000000, 0x00000007c0000000)
   the space 87424K,   0% used [0x000000076aaa0000, 0x000000076ab3dd90, 0x000000076ab3de00, 0x0000000770000000)
 Metaspace       used 3365K, capacity 4496K, committed 4864K, reserved 1056768K
  class space    used 372K, capacity 388K, committed 512K, reserved 1048576K

Process finished with exit code 0

-verbose:gc -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+UseParallelGC

PSYoungGen 年轻代使用Parallel
ParOldGen 老年代使用serial 收集器 虽然名称也叫做ParOldGen 但是实际使用的是serial 收集器

{Heap before GC invocations=1 (full 0):
 PSYoungGen      total 38400K, used 7437K [0x0000000795580000, 0x0000000798000000, 0x00000007c0000000)
  eden space 33280K, 22% used [0x0000000795580000,0x0000000795cc34a0,0x0000000797600000)
  from space 5120K, 0% used [0x0000000797b00000,0x0000000797b00000,0x0000000798000000)
  to   space 5120K, 0% used [0x0000000797600000,0x0000000797600000,0x0000000797b00000)
 ParOldGen       total 87552K, used 0K [0x0000000740000000, 0x0000000745580000, 0x0000000795580000)
  object space 87552K, 0% used [0x0000000740000000,0x0000000740000000,0x0000000745580000)
 Metaspace       used 3357K, capacity 4496K, committed 4864K, reserved 1056768K
  class space    used 371K, capacity 388K, committed 512K, reserved 1048576K
[GC (System.gc()) [PSYoungGen: 7437K->768K(38400K)] 7437K->776K(125952K), 0.0011962 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
Heap after GC invocations=1 (full 0):
 PSYoungGen      total 38400K, used 768K [0x0000000795580000, 0x0000000798000000, 0x00000007c0000000)
  eden space 33280K, 0% used [0x0000000795580000,0x0000000795580000,0x0000000797600000)
  from space 5120K, 15% used [0x0000000797600000,0x00000007976c0000,0x0000000797b00000)
  to   space 5120K, 0% used [0x0000000797b00000,0x0000000797b00000,0x0000000798000000)
 ParOldGen       total 87552K, used 8K [0x0000000740000000, 0x0000000745580000, 0x0000000795580000)
  object space 87552K, 0% used [0x0000000740000000,0x0000000740002000,0x0000000745580000)
 Metaspace       used 3357K, capacity 4496K, committed 4864K, reserved 1056768K
  class space    used 371K, capacity 388K, committed 512K, reserved 1048576K
}
{Heap before GC invocations=2 (full 1):
 PSYoungGen      total 38400K, used 768K [0x0000000795580000, 0x0000000798000000, 0x00000007c0000000)
  eden space 33280K, 0% used [0x0000000795580000,0x0000000795580000,0x0000000797600000)
  from space 5120K, 15% used [0x0000000797600000,0x00000007976c0000,0x0000000797b00000)
  to   space 5120K, 0% used [0x0000000797b00000,0x0000000797b00000,0x0000000798000000)
 ParOldGen       total 87552K, used 8K [0x0000000740000000, 0x0000000745580000, 0x0000000795580000)
  object space 87552K, 0% used [0x0000000740000000,0x0000000740002000,0x0000000745580000)
 Metaspace       used 3357K, capacity 4496K, committed 4864K, reserved 1056768K
  class space    used 371K, capacity 388K, committed 512K, reserved 1048576K
[Full GC (System.gc()) [PSYoungGen: 768K->0K(38400K)] [ParOldGen: 8K->631K(87552K)] 776K->631K(125952K), [Metaspace: 3357K->3357K(1056768K)], 0.0061276 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 
Heap after GC invocations=2 (full 1):
 PSYoungGen      total 38400K, used 0K [0x0000000795580000, 0x0000000798000000, 0x00000007c0000000)
  eden space 33280K, 0% used [0x0000000795580000,0x0000000795580000,0x0000000797600000)
  from space 5120K, 0% used [0x0000000797600000,0x0000000797600000,0x0000000797b00000)
  to   space 5120K, 0% used [0x0000000797b00000,0x0000000797b00000,0x0000000798000000)
 ParOldGen       total 87552K, used 631K [0x0000000740000000, 0x0000000745580000, 0x0000000795580000)
  object space 87552K, 0% used [0x0000000740000000,0x000000074009dd90,0x0000000745580000)
 Metaspace       used 3357K, capacity 4496K, committed 4864K, reserved 1056768K
  class space    used 371K, capacity 388K, committed 512K, reserved 1048576K
}
Heap
 PSYoungGen      total 38400K, used 333K [0x0000000795580000, 0x0000000798000000, 0x00000007c0000000)
  eden space 33280K, 1% used [0x0000000795580000,0x00000007955d34a8,0x0000000797600000)
  from space 5120K, 0% used [0x0000000797600000,0x0000000797600000,0x0000000797b00000)
  to   space 5120K, 0% used [0x0000000797b00000,0x0000000797b00000,0x0000000798000000)
 ParOldGen       total 87552K, used 631K [0x0000000740000000, 0x0000000745580000, 0x0000000795580000)
  object space 87552K, 0% used [0x0000000740000000,0x000000074009dd90,0x0000000745580000)
 Metaspace       used 3364K, capacity 4496K, committed 4864K, reserved 1056768K
  class space    used 372K, capacity 388K, committed 512K, reserved 1048576K

Process finished with exit code 0

-verbose:gc -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+UseParallelOldGC

PSYoungGen 年轻代使用Parallel
ParOldGen 老年代使用Parallel

{Heap before GC invocations=1 (full 0):
 PSYoungGen      total 38400K, used 7437K [0x0000000795580000, 0x0000000798000000, 0x00000007c0000000)
  eden space 33280K, 22% used [0x0000000795580000,0x0000000795cc34a0,0x0000000797600000)
  from space 5120K, 0% used [0x0000000797b00000,0x0000000797b00000,0x0000000798000000)
  to   space 5120K, 0% used [0x0000000797600000,0x0000000797600000,0x0000000797b00000)
 ParOldGen       total 87552K, used 0K [0x0000000740000000, 0x0000000745580000, 0x0000000795580000)
  object space 87552K, 0% used [0x0000000740000000,0x0000000740000000,0x0000000745580000)
 Metaspace       used 3358K, capacity 4496K, committed 4864K, reserved 1056768K
  class space    used 371K, capacity 388K, committed 512K, reserved 1048576K
[GC (System.gc()) [PSYoungGen: 7437K->768K(38400K)] 7437K->776K(125952K), 0.0024368 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] 
Heap after GC invocations=1 (full 0):
 PSYoungGen      total 38400K, used 768K [0x0000000795580000, 0x0000000798000000, 0x00000007c0000000)
  eden space 33280K, 0% used [0x0000000795580000,0x0000000795580000,0x0000000797600000)
  from space 5120K, 15% used [0x0000000797600000,0x00000007976c0000,0x0000000797b00000)
  to   space 5120K, 0% used [0x0000000797b00000,0x0000000797b00000,0x0000000798000000)
 ParOldGen       total 87552K, used 8K [0x0000000740000000, 0x0000000745580000, 0x0000000795580000)
  object space 87552K, 0% used [0x0000000740000000,0x0000000740002000,0x0000000745580000)
 Metaspace       used 3358K, capacity 4496K, committed 4864K, reserved 1056768K
  class space    used 371K, capacity 388K, committed 512K, reserved 1048576K
}
{Heap before GC invocations=2 (full 1):
 PSYoungGen      total 38400K, used 768K [0x0000000795580000, 0x0000000798000000, 0x00000007c0000000)
  eden space 33280K, 0% used [0x0000000795580000,0x0000000795580000,0x0000000797600000)
  from space 5120K, 15% used [0x0000000797600000,0x00000007976c0000,0x0000000797b00000)
  to   space 5120K, 0% used [0x0000000797b00000,0x0000000797b00000,0x0000000798000000)
 ParOldGen       total 87552K, used 8K [0x0000000740000000, 0x0000000745580000, 0x0000000795580000)
  object space 87552K, 0% used [0x0000000740000000,0x0000000740002000,0x0000000745580000)
 Metaspace       used 3358K, capacity 4496K, committed 4864K, reserved 1056768K
  class space    used 371K, capacity 388K, committed 512K, reserved 1048576K
[Full GC (System.gc()) [PSYoungGen: 768K->0K(38400K)] [ParOldGen: 8K->631K(87552K)] 776K->631K(125952K), [Metaspace: 3358K->3358K(1056768K)], 0.0184097 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 
Heap after GC invocations=2 (full 1):
 PSYoungGen      total 38400K, used 0K [0x0000000795580000, 0x0000000798000000, 0x00000007c0000000)
  eden space 33280K, 0% used [0x0000000795580000,0x0000000795580000,0x0000000797600000)
  from space 5120K, 0% used [0x0000000797600000,0x0000000797600000,0x0000000797b00000)
  to   space 5120K, 0% used [0x0000000797b00000,0x0000000797b00000,0x0000000798000000)
 ParOldGen       total 87552K, used 631K [0x0000000740000000, 0x0000000745580000, 0x0000000795580000)
  object space 87552K, 0% used [0x0000000740000000,0x000000074009dd90,0x0000000745580000)
 Metaspace       used 3358K, capacity 4496K, committed 4864K, reserved 1056768K
  class space    used 371K, capacity 388K, committed 512K, reserved 1048576K
}
Heap
 PSYoungGen      total 38400K, used 333K [0x0000000795580000, 0x0000000798000000, 0x00000007c0000000)
  eden space 33280K, 1% used [0x0000000795580000,0x00000007955d34a8,0x0000000797600000)
  from space 5120K, 0% used [0x0000000797600000,0x0000000797600000,0x0000000797b00000)
  to   space 5120K, 0% used [0x0000000797b00000,0x0000000797b00000,0x0000000798000000)
 ParOldGen       total 87552K, used 631K [0x0000000740000000, 0x0000000745580000, 0x0000000795580000)
  object space 87552K, 0% used [0x0000000740000000,0x000000074009dd90,0x0000000745580000)
 Metaspace       used 3365K, capacity 4496K, committed 4864K, reserved 1056768K
  class space    used 372K, capacity 388K, committed 512K, reserved 1048576K

Process finished with exit code 0


相关文章

  • G1收集器详解

    详解 JVM Garbage First(G1) 垃圾收集器 G1垃圾收集器入门

  • jvm垃圾收集器验证

    java -XX:+PrintCommandLineFlags -version -verbose:gc -XX...

  • 2020互联网Java后端面试专题解析—JVM21题

    前言 文章对 JVM 内存区域分布、JVM 内存溢出分析、JVM 垃圾回收算法/垃圾收集器、JVM 性能调优工具及...

  • 5种JVM垃圾收集器特点和8种JVM内存溢出原因

    先来看看5种JVM垃圾收集器特点 一、常见垃圾收集器 现在常见的垃圾收集器有如下几种: 新生代收集器: Seria...

  • Jvm之CMS垃圾收集器

      这篇文章主要介绍JVM的CMS垃圾收集器,以及JVM提供的垃圾收集算法。 一、垃圾收集算法   JVM提供的三...

  • GC - 收集器

    概述 垃圾收集器是垃圾回收算法的具体实现,不同商家、不同版本的 JVM 所提供的垃圾收集器可能会有差别 收集器组合...

  • JVM源码分析系列

    JVM G1算法系列 G1垃圾收集器介绍 G1垃圾收集器之RSet G1垃圾收集器之SATB G1垃圾收集器之对象...

  • JVM垃圾回收

    JVM垃圾收集器 一、垃圾收集器的分类 1.1 Serial GC 出现的最早,比较古老,最大的特点就是垃圾收集策...

  • JVM

    JVM(1):Java 类的加载机制 JVM(2):JVM内存结构 JVM(3):Java GC算法 垃圾收集器 ...

  • JVM垃圾收集器总结

    通过上篇JVM垃圾回收算法和垃圾收集器我们对JVM的七大垃圾收集器的运行原理有了大致的了解,我们来总结一下他们之间...

网友评论

      本文标题:jvm垃圾收集器验证

      本文链接:https://www.haomeiwen.com/subject/munaahtx.html