Skip to content

Latest commit

 

History

History

jvm-memory-and-tuning

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

JVM Memory and Tuning Topics

The JVM has many options around tuning memory usage and the behvior of the garbage collector.

Microbenchmarking

The JVM uses a Just In Time Compiler (JIT), so you must warm code up before you test it. Java first executes code using an interpreter then decides to compile code when it gets hot. In order to make sure your code is compiled you should consider using this JVM flag:

-XX:+PrintCompilation

Youtube Videos:

Intro to JVM Memory - shows allocating arrays program

Some nice tutorials and blog posts

Java Heap Space vs Stack

Cool diagrams:

heap vs non-heap

Official Oracle Docs on HotSpot VM:

Hotspot VM At A Glance

Oracle HotSpot VM options

General GC Tuning Guide