[GC (Allocation Failure) [PSYoungGen: 1752K->488K(2560K)] 1752K->664K(9728K), 0.0018961 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] [GC (Allocation Failure) [PSYoungGen: 488K->496K(2560K)] 664K->716K(9728K), 0.0015663 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] [Full GC (Allocation Failure) [PSYoungGen: 496K->0K(2560K)] [ParOldGen: 220K->629K(7168K)] 716K->629K(9728K), [Metaspace: 3216K->3216K(1056768K)], 0.0066899 secs] [Times: user=0.02 sys=0.00, real=0.01 secs] [GC (Allocation Failure) [PSYoungGen: 0K->0K(2560K)] 629K->629K(9728K), 0.0004493 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] [Full GC (Allocation Failure) [PSYoungGen: 0K->0K(2560K)] [ParOldGen: 629K->611K(7168K)] 629K->611K(9728K), [Metaspace: 3216K->3216K(1056768K)], 0.0068001 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] Exception in thread “main” java.lang.OutOfMemoryError: Java heap space at tech.xixing.jvm.HelloGC.main(HelloGC.java:15) Heap PSYoungGen total 2560K, used 57K [0x00000000ffd00000, 0x0000000100000000, 0x0000000100000000) eden space 2048K, 2% used [0x00000000ffd00000,0x00000000ffd0e588,0x00000000fff00000) from space 512K, 0% used [0x00000000fff00000,0x00000000fff00000,0x00000000fff80000) to space 512K, 0% used [0x00000000fff80000,0x00000000fff80000,0x0000000100000000) ParOldGen total 7168K, used 611K [0x00000000ff600000, 0x00000000ffd00000, 0x00000000ffd00000) object space 7168K, 8% used [0x00000000ff600000,0x00000000ff698f48,0x00000000ffd00000) Metaspace used 3247K, capacity 4496K, committed 4864K, reserved 1056768K class space used 353K, capacity 388K, committed 512K, reserved 1048576K
Process finished with exit code 1
-XX:SurvivorRatio
默认XX:SurvivorRatio=8
eden space 53248K, 8% used [0x0000000780980000,0x0000000780dab0f0,0x0000000783d80000) from space 6144K, 0% used [0x0000000784380000,0x0000000784380000,0x0000000784980000) to space 6144K, 0% used [0x0000000783d80000,0x0000000783d80000,0x0000000784380000)
XX:SurvivorRatio=4
PSYoungGen total 54784K, used 4404K [0x0000000780980000, 0x0000000784980000, 0x00000007c0000000) eden space 44032K, 10% used [0x0000000780980000,0x0000000780dcd328,0x0000000783480000) from space 10752K, 0% used [0x0000000783f00000,0x0000000783f00000,0x0000000784980000) to space 10752K, 0% used [0x0000000783480000,0x0000000783480000,0x0000000783f00000)
-XX:NewRatio
Heap PSYoungGen total 54784K, used 4404K [0x0000000780980000, 0x0000000784980000, 0x00000007c0000000) eden space 44032K, 10% used [0x0000000780980000,0x0000000780dcd328,0x0000000783480000) from space 10752K, 0% used [0x0000000783f00000,0x0000000783f00000,0x0000000784980000) to space 10752K, 0% used [0x0000000783480000,0x0000000783480000,0x0000000783f00000) ParOldGen total 131072K, used 0K [0x0000000701c00000, 0x0000000709c00000, 0x0000000780980000) object space 131072K, 0% used [0x0000000701c00000,0x0000000701c00000,0x0000000709c00000) Metaspace used 3222K, capacity 4496K, committed 4864K, reserved 1056768K class space used 350K, capacity 388K, committed 512K, reserved 1048576K
publicstatic ExecutorService newSingleThreadExecutor(){ returnnew FinalizableDelegatedExecutorService (new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>())); } publicstatic ExecutorService newCachedThreadPool(){ returnnew ThreadPoolExecutor(0, Integer.MAX_VALUE, 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>()); }
publicThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler)