Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JDK 8 Memory Layout and garbage collection

From what I know, starting with JDK 8 the PermGen will be a past page in java's history. Everything nice and merry... but what will the new Memory Layout look like? Will this affect GC on the new platform?

like image 926
Olimpiu POP Avatar asked Dec 13 '13 09:12

Olimpiu POP


People also ask

What is Java 8 default garbage collector?

Parallel/Throughput GC This is JVM's default collector in JDK 8. As the name suggests, it uses multiple threads to scan through the heap space and perform compaction. A drawback of this collector is that it pauses the application threads while performing minor or full GC.

What is the memory model in Java 8?

The default size of PermGen memory is 64 MB on 32-bit JVM and 82 MB on the 64-bit version. Due to this, JVM had to change the size of this memory by frequently performing Garbage collection which is a costly operation. Java also allows to manually change the size of the PermGen memory.

What is the fastest garbage collector in Java 8?

The results are clear: That default (Parallel GC) is the fastest.

Can we use g1gc in Java 8?

Explicitly Set the GC Algorithm For example on Java 8, the default GC is Parallel GC, while on Java 11 the default is G1 GC. This means that on upgrading your Java version, this will be changed on your behalf, for better or worse, unless you've explicitly set the GC.


1 Answers

PermGen is replaced with Metaspace in Oracle/Sun JDK8, which is very similar. The main difference is that Metaspace can expand at runtime.

like image 86
Adam Dyga Avatar answered Sep 20 '22 13:09

Adam Dyga