Notes on JVM Anatomy talk by Nikita Lipsky

My notes from the insightful talk “JVM Anatomy 101” by Nikita Lipsky. The talk provides a deep dive into the internals of Java Virtual Machine (JVM), covering everything from bytecode and class loading to memory management and garbage collection. You can watch the original talk here. Java class file and bytecode Class file Version Constant Pool Class name, modifiers Superclass, superinterfaces Fields Methods Attributes Fields, methods may have attributes (e.g., values of constant fields) The main attributes of a method is its code: Java bytecode Java bytecode Instruction array Operand stack Local variables array (method arguments, local variables) In the JVM specification each instruction is strictly defined. Two different JVMs that obey JVM specification have no chance to execute the same bytecode differently. ...

September 20, 2025 · 10 min · 1938 words

Memory-safe code in Java

While Java’s garbage collection handles most memory-related tasks automatically, developers still need to be aware of certain patterns and practices that can lead to memory leaks. This article explores common scenarios where memory management requires special attention and provides guidelines for writing memory-safe code in Java applications. Patterns here were observed while developing applets, but they should be applicable to any Java application. Static Objects Static objects are treated as singletons and never collected from memory. They can be retained even if the app is destroyed on mobile platforms. If a static object holds reference to other objects, those objects will be retained as well. ...

September 11, 2025 · 2 min · 392 words