🚀 Visualizing memory management in JVM(Java, Kotlin, Scala, Groovy, Clojure)

Click for: original source

In this multi-part series, author aims to demystify the concepts behind memory management and take a deeper look at memory management in some of the modern programming languages. By Deepu K Sasidharan; JHipster co-lead, Java, JS, Cloud Native Advocate, Developer Advocate @ Adyen, Author, Speaker, Software craftsman.

The series should give you some insights into what is happening under the hood of these languages in terms of memory management. In this chapter, we will look at the memory management of the Java Virtual Machine(JVM) used by languages like Java, Kotlin, Scala, Clojure, JRuby and so on.

Heap memory allocation

Source: https://deepu.tech/memory-management-in-jvm/

The article then focuses on:

  • JVM memory structure
  • Heap memory
  • Thread stacks
  • Meta space
  • Code cache
  • JVM memory usage (Stack vs Heap)
  • JVM Memory management: Garbage collection
  • Mark & Sweep Garbage collection

… and more. JVM manages the heap memory by garbage collection. In simple terms, it frees the memory used by orphan objects, i.e, objects that are no longer referenced from the Stack directly or indirectly(via a reference in another object) to make space for new object creation.

Slide presentation is always provided for your benefit, together with code examples. Refreshing read!

[Read More]

Tags java scala jvm performance