博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
新生代大小对GC的影响
阅读量:5845 次
发布时间:2019-06-18

本文共 9422 字,大约阅读时间需要 31 分钟。

 
import java.util.Vector; /**  * Created by xxd on 2017/4/2.  */ public class DumpOOM {
public static void main(String[] args){
Vector v = new Vector(); for (int i=0;i<25;i++){
v.add(new byte[1*1024*1024]); } } }
"C:\Program Files\Java\jdk1.8.0_121\bin\java" -Xmx20m -Xms20m -Xmn1m -XX:SurvivorRatio=2 -XX:+PrintGCDetails -Didea.launcher.port=7534 "-Didea.launcher.bin.path=E:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_121\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\rt.jar;F:\idea_workspace\jvmDebug\out\production\jvmDebug;E:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain NewSizeDemo
[GC (Allocation Failure) [PSYoungGen: 512K->504K(1024K)] 512K->512K(19968K), 0.0007921 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC (Allocation Failure) [PSYoungGen: 1016K->488K(1024K)] 1024K->684K(19968K), 0.0006238 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
Java HotSpot(TM) 64-Bit Server VM warning: NewSize (1536k) is greater than the MaxNewSize (1024k). A new max generation size of 1536k will be used. 
Heap
 PSYoungGen      total 1024K, used 582K [0x00000000ffe80000, 0x0000000100000000, 0x0000000100000000)
  eden space 512K, 18% used [0x00000000ffe80000,0x00000000ffe97bd0,0x00000000fff00000)
  from space 512K, 95% used [0x00000000fff80000,0x00000000ffffa020,0x0000000100000000)
  to   space 512K, 0% used [0x00000000fff00000,0x00000000fff00000,0x00000000fff80000)
 ParOldGen       total 18944K, used 10436K [0x00000000fec00000, 0x00000000ffe80000, 0x00000000ffe80000)
  object space 18944K, 55% used [0x00000000fec00000,0x00000000ff6310b0,0x00000000ffe80000)
 Metaspace       used 3305K, capacity 4494K, committed 4864K, reserved 1056768K
  class space    used 362K, capacity 386K, committed 512K, reserved 1048576K
Process finished with exit code 0
===================================================================================================================================================
-Xmx20m -Xms20m -Xmn7m -XX:SurvivorRatio=2 -XX:+PrintGCDetails
"C:\Program Files\Java\jdk1.8.0_121\bin\java" -Xmx20m -Xms20m -Xmn7m -XX:SurvivorRatio=2 -XX:+PrintGCDetails -Didea.launcher.port=7535 "-Didea.launcher.bin.path=E:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_121\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\rt.jar;F:\idea_workspace\jvmDebug\out\production\jvmDebug;E:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain NewSizeDemo
[GC (Allocation Failure) [PSYoungGen: 3343K->864K(5632K)] 3343K->1896K(18944K), 0.0025715 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC (Allocation Failure) [PSYoungGen: 4056K->1520K(5632K)] 5088K->2820K(18944K), 0.0010995 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC (Allocation Failure) [PSYoungGen: 4688K->1528K(5632K)] 5988K->2828K(18944K), 0.0006183 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
Heap
 PSYoungGen      total 5632K, used 3707K [0x00000000ff900000, 0x0000000100000000, 0x0000000100000000)
  eden space 4096K, 53% used [0x00000000ff900000,0x00000000ffb20fa8,0x00000000ffd00000)
  from space 1536K, 99% used [0x00000000ffd00000,0x00000000ffe7e040,0x00000000ffe80000)
  to   space 1536K, 0% used [0x00000000ffe80000,0x00000000ffe80000,0x0000000100000000)
 ParOldGen       total 13312K, used 1300K [0x00000000fec00000, 0x00000000ff900000, 0x00000000ff900000)
  object space 13312K, 9% used [0x00000000fec00000,0x00000000fed45020,0x00000000ff900000)
 Metaspace       used 3269K, capacity 4494K, committed 4864K, reserved 1056768K
  class space    used 360K, capacity 386K, committed 512K, reserved 1048576K
Process finished with exit code 0
===================================================================================================================================================
-Xmx20m -Xms20m -Xmn15m -XX:SurvivorRatio=2 -XX:+PrintGCDetails
"C:\Program Files\Java\jdk1.8.0_121\bin\java" -Xmx20m -Xms20m -Xmn15m -XX:SurvivorRatio=2 -XX:+PrintGCDetails -Didea.launcher.port=7536 "-Didea.launcher.bin.path=E:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_121\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_121\jre\lib\rt.jar;F:\idea_workspace\jvmDebug\out\production\jvmDebug;E:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain NewSizeDemo
[GC (Allocation Failure) [PSYoungGen: 7627K->1920K(11776K)] 7627K->1928K(16896K), 0.0014507 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
Heap
 PSYoungGen      total 11776K, used 6338K [0x00000000ff100000, 0x0000000100000000, 0x0000000100000000)
  eden space 8192K, 53% used [0x00000000ff100000,0x00000000ff550b58,0x00000000ff900000)
  from space 3584K, 53% used [0x00000000ff900000,0x00000000ffae0040,0x00000000ffc80000)
  to   space 3584K, 0% used [0x00000000ffc80000,0x00000000ffc80000,0x0000000100000000)
 ParOldGen       total 5120K, used 8K [0x00000000fec00000, 0x00000000ff100000, 0x00000000ff100000)
  object space 5120K, 0% used [0x00000000fec00000,0x00000000fec02000,0x00000000ff100000)
 Metaspace       used 3279K, capacity 4494K, committed 4864K, reserved 1056768K
  class space    used 361K, capacity 386K, committed 512K, reserved 1048576K
Process finished with exit code 0
===================================================================================================================================================

转载于:https://www.cnblogs.com/xxdfly/p/cf6bf5d185d8c2302a7c7154ce2bcb97.html

你可能感兴趣的文章
cookie 和session 的区别详解
查看>>
windows编译hadoop 2.x Hadoop-eclipse-plugin插件
查看>>
我的友情链接
查看>>
Deploy A MongoDB 4.0 Sharded Cluster
查看>>
国际化支持
查看>>
jquery判断对象是否存在
查看>>
puppet故障分析Host is missing hostname and/or domain
查看>>
windows下远程访问连接方式
查看>>
我的友情链接
查看>>
kubernetes之基本使用2
查看>>
commons-pool实战之 PoolableObjectFactory和ObjectPool
查看>>
高性能WEB开发之flush让页面分块逐步呈现
查看>>
linux的wget命令
查看>>
xp重做系统时蓝屏解决方法
查看>>
百度地图api练习
查看>>
【VMCloud云平台】私有云门户第一朵SQL云
查看>>
Maven常用的命令
查看>>
高级排版之HTML,CSS解析
查看>>
centos中配置nfs固定端口
查看>>
A标签执行JS脚本
查看>>