June 2018
Intermediate to advanced
316 pages
6h 34m
English
When the JVM starts, it allocates heap memory from the operating system and then manages that memory. Whenever an application creates a new object, the JVM automatically allocates a block of memory with a size that's big enough to fit the new object on the heap. After sweeping, in most cases, memory becomes fragmented. Memory fragmentation leads to two problems:
The following diagram illustrates a fragmented memory heap:
To avoid these problems after each GC cycle, the JVM executes a compaction step. Compacting ...
Read now
Unlock full access