Best of JVM — 2024

  1. 1
    Article
    Avatar of baeldungBaeldung·2y

    Reduce Memory Footprint in Java

    Application size is crucial for performance, and optimizing memory usage can significantly reduce an application's memory footprint. This guide explains how to estimate the memory size of Java applications, explore techniques like using primitive types, combining classes, and bit packing for optimizing memory. It also covers using the Java Object Layout (JOL) library for verification and comparing standard Java collections with third-party libraries like Eclipse Collection for additional optimization.

  2. 2
    Article
    Avatar of inside_javaInside Java·2y

    The Reflection API

    Reflection in Java allows examination or modification of runtime behavior of applications running in the Java virtual machine. This powerful yet advanced feature should be used by developers with a strong grasp of Java. Key topics include retrieving class instances, reading class names and modifiers, accessing fields, invoking methods and constructors, working with arrays, enumerations, and records, reading annotations, and creating interceptors and dependency injection frameworks.

  3. 3
    Article
    Avatar of foojayioFoojay.io·2y

    Book Review: Mastering the Java Virtual Machine

    Otávio Santana's 'Mastering the Java Virtual Machine' offers an in-depth exploration of JVM internals, combining nostalgic elements of Java programming with modern concepts. The book covers JVM architecture, performance optimization, class file structure, bytecode operations, memory management, JIT compilation, garbage collection, alternative JVMs like GraalVM, and advanced topics such as Java frameworks, reflection API, and code generation. It's an essential resource for Java developers aiming to improve their understanding and efficiency in Java development.

  4. 4
    Article
    Avatar of communityCommunity Picks·2y

    A list of major Java and JVM features since JDK 17 to 22

    An overview of major Java and JVM features from JDK 17 to 22, including sealed classes, pattern matching enhancements, and the Foreign Function and Memory API.

  5. 5
    Article
    Avatar of baeldungBaeldung·1y

    Exploring Advanced JVM Options

    The Java Virtual Machine (JVM) offers a range of advanced options to fine-tune its performance, manage memory, and conduct diagnostics. These options include configurations for garbage collection, memory management, Just-in-Time (JIT) compilation, and debugging. Developers can achieve optimal application performance by understanding and appropriately using these advanced settings, while also considering potential changes in future JVM versions.

  6. 6
    Article
    Avatar of infoworldInfoWorld·2y

    Better than reflection: Using method handles and variable handles in Java

    MethodHandles and VarHandles present safer and more performant alternatives to Java's reflection API. They allow programmatic access to methods and fields with a cleaner and more structured API. While they don't cover all the capabilities of reflection, they are preferred for accessing class metadata and manipulating methods and fields. Migrating away from reflection is necessary as it becomes deprecated, and the JVM is increasingly adopting these new methods.

  7. 7
    Article
    Avatar of justjavaJust Java·2y

    Serialization in Java: A Quick Insight on serialVersionUID 🚀

    The post delves into the significance of serialVersionUID in Java serialization. It explains how this unique identifier ensures compatibility during deserialization, preventing InvalidClassException. Explicitly declaring serialVersionUID helps maintain backward compatibility, avoid issues in distributed environments, and control serialization changes. Guidance is provided on when to update the serialVersionUID based on the nature of class changes.

  8. 8
    Article
    Avatar of happycodersHappyCoders.eu·1y

    Java Object Headers and Compressed OOPs​

    Java objects in memory include data and an Object Header, which contains the Mark Word and Class Word. These store essential information like the object's identity hash code, age, lock state, and reference to its class. Compressed OOPs allow addressing 32 GB of memory using 32-bit pointers by leveraging object alignment in memory. This trade-off between performance and memory space is enabled by default but can be disabled with a VM option. Future enhancements aim to further reduce object header size.

  9. 9
    Article
    Avatar of java_libhuntAwesome Java Newsletter·1y

    Z Garbage Collector in Java

    Java applications have diverse performance requirements, such as throughput, latency, and scalability. The Z Garbage Collector (ZGC) is designed to minimize pause times while efficiently managing large heap sizes. Unlike traditional garbage collectors that can cause significant application pauses, ZGC performs most of its work concurrently with the application, achieving minimal interruptions. This makes it ideal for high-demand environments like financial systems and large-scale cloud applications. The article includes a practical comparison between ZGC and G1 GC, showcasing ZGC's superior performance in maintaining low latency.

  10. 10
    Article
    Avatar of jetbrainsJetBrains·2y

    Ktor 101: Efficient JVM HTTP Toolkit

    Ktor is a toolkit for building server applications on the JVM using Kotlin. It leverages Kotlin's features like coroutines to ensure efficient and flexible web applications. Ktor includes essential components for web development such as routing, authentication, and support for various protocols, including HTTP and WebSockets. With native support for asynchronous programming, it allows for declarative and non-blocking code. The toolkit also provides built-in testability and extensibility through plugins and interceptors, making it suitable for modern application architectures like microservices.

  11. 11
    Article
    Avatar of javarevisitedJavarevisited·1y

    7 Types of Garbage Collectors in Java

    The post provides an overview of garbage collection in Java and details seven garbage collectors: Serial GC, Parallel GC, Concurrent Mark Sweep GC, Z GC, G1 GC, Shenandoah GC, and Epsilon GC. It explains the metrics used to evaluate GC algorithms, such as latency, throughput, and memory footprint. Each garbage collector is described with its use cases and how to enable it in Java.

  12. 12
    Article
    Avatar of baeldungBaeldung·2y

    Deep Dive Into JVM Tools: Dynamic Attach and Serviceability Agent

    JVM serviceability tools like Dynamic Attach and the Serviceability Agent are critical for managing Java applications in production environments. Dynamic Attach allows real-time diagnostics and dynamic loading of Java agents without restarting the application, but has limitations like potential performance overhead and compatibility issues. The Serviceability Agent provides deep insights into JVM internals, allowing post-mortem debugging and thorough analysis of thread states, memory usage, and locking issues. Both tools complement each other, with Dynamic Attach focusing on live applications and the Serviceability Agent offering comprehensive post-mortem analysis.

  13. 13
    Article
    Avatar of jetbrainsJetBrains·2y

    Hacking a JVM Application With IntelliJ IDEA’s Debugger

    The post explores using IntelliJ IDEA's debugger to modify the behavior of a JVM application, specifically adding 'god mode' to a Space Invaders game plugin. It covers setting up multiple IDE instances, configuring JVM options, and using the debugger's memory view and non-suspending breakpoints to change object properties and automate state modifications.

  14. 14
    Video
    Avatar of java_libhuntAwesome Java Newsletter·2y

    Java, How Fast Can You Parse 1 Billion Rows of Weather Data? • Roy van Rijn • GOTO 2024

  15. 15
    Article
    Avatar of infoworldInfoWorld·1y

    Kotlin for Java developers: Classes and coroutines

    Kotlin, designed for JVM, simplifies programming with classes and concurrency. It offers features like data classes, function extensions, and easy object creation. Kotlin's coroutines enhance concurrency by providing structured concurrency, making thread management easier. It blends seamlessly with Java, offering a flexible and modern approach to coding.

  16. 16
    Article
    Avatar of thisdotThis Dot·1y

    Java’s AI Evolution: Semantic Caching JVM, and GenAI Architectures with Theresa Mamarella & Brian Sam-Bodden

    Danny Thompson talks with Theresa Mammarella and Brian Sam-Bodden about the advancements in Java, including GenAI architectures and OpenJDK's Project Valhalla. They discuss semantic caching, AI applications in Java, and performance optimization. The conversation also touches on the cost of LLMs and strategies for Java’s future.

  17. 17
    Video
    Avatar of java_libhuntAwesome Java Newsletter·1y

    Java 24 Language & API Changes - Inside Java Newscast #81

  18. 18
    Article
    Avatar of pandProAndroidDev·2y

    Kotlin reified Explained (no more type erasure)

    Kotlin solves the problem of type erasure at runtime by introducing the 'reified' keyword, which preserves type information. This keyword works in conjunction with inline functions, allowing code to be moved to the call site and maintaining type information. This approach enables writing more generic and readable algorithms.

  19. 19
    Video
    Avatar of communityCommunity Picks·1y

    NANOWAR OF STEEL - HelloWorld.java (Source Code Video) | Napalm Records

    Nanowar of Steel has released a new music video titled 'HelloWorld.java' under Napalm Records. The song explores themes related to Java programming, including concepts such as static typing, garbage collection, and JVM management. The lyrics playfully intertwine programming terms with music, aiming to resonate with both developers and metal music enthusiasts.

  20. 20
    Article
    Avatar of baeldungBaeldung·1y

    Setting the Gradle JVM in IntelliJ IDEA

    Learn how to change the JVM version used by Gradle in IntelliJ IDEA. The guide covers locating the current JVM settings via menu navigation or keyboard shortcuts, updating the JVM version for Gradle operations, and the implications of these changes, including reindexing and synchronization of IDE features. Note that this setting only affects Gradle builds within IntelliJ and not from the command line or other IDEs.

  21. 21
    Article
    Avatar of justjavaJust Java·2y

    A talk on how the JVM works

    JVMs are essential for Java execution, requiring bytecode for consistent performance. Java class files are complex, with bytecode verification ensuring safety and correctness. JVM execution can involve interpreting or compiling bytecode, with tools enhancing performance. Efficient multithreading management and garbage collection are critical for memory and performance, maintaining Java's balance of speed and dynamic features.

  22. 22
    Article
    Avatar of happycodersHappyCoders.eu·1y

    Compressed Oops in Java

    Learn how Compressed Oops is used on 64-bit systems to represent references to Java objects with 32 bits instead of 64, significantly reducing memory requirements. The technique allows addressing 32 GB of memory using 32-bit pointers by positioning Java objects at memory addresses divisible by eight and shifting bits. Compressed Oops are enabled by default for heaps up to 32 GB but can be disabled with a VM option to squeeze out extra performance at the cost of increased memory use.

  23. 23
    Article
    Avatar of java_libhuntAwesome Java Newsletter·2y

    A Java Language Cumulative Feature Rollup

    The post provides a comprehensive list of Java language features introduced in various JDK releases, categorized by language, library, and JVM features. It highlights key additions, deprecations, and removals from JDK 11 to JDK 21, including pattern matching for switch, virtual threads, and the Generational ZGC garbage collector. It also covers changes in Java documentation and preview features offered in recent updates.

  24. 24
    Article
    Avatar of baeldungBaeldung·1y

    Introduction to SootUp

    SootUp is a library designed for performing static analysis on JVM code, either using original source code or compiled bytecode. It improves upon the Soot library by being more modular and easier to maintain. SootUp converts code into an intermediate representation called Jimple, which makes analysis simpler. The post provides details on dependencies, code analysis, accessing classes and methods, and analyzing method bodies using SootUp.

  25. 25
    Article
    Avatar of droidcondroidcon·2y

    Internal Mechanism of val in Kotlin

    Kotlin's `val` keyword is used to declare immutable variables, ensuring they can only be assigned once. This immutability is enforced through the compilation of Kotlin code into Java bytecode, where `val` variables are marked with the Java `final` modifier. The use of `val` enhances thread safety, code clarity, and performance, particularly in concurrent programming.