Does Java Really Use Too Much Memory? Let’s Look at the Facts (JEPs)
Table of Contents The reputation didn’t come out of nowhere.Modern Java: What Actually Changed?1. Garbage Collection Is Not What It Used to Be2. Threads Got Lighter (Much Lighter)3. Java Objects Are Literally Getting Smaller4. The JVM Learned to Share (CDS)5. ...
-
Clean your Memory: From Finalize to Cleaner
Table of Contents Why is the finalize() method deprecated/removed?How does Cleaner relate to Java Reference classes?Behind the scenes of CleanerCleaner vs. try-with-resourcesAvoid overusing CleanerConclusionFurther ResourcesGarbage collection in Java takes care of memory management, but it does not clean up non-memory …
-
How JVM handles exceptions
Table of Contents ExampleException tableBytecode instructionsTry-catch-finally flowLess nice flowSummarized flowIt’s interesting to know how the JVM runs bytecode instructions… But do you know what is going on when an exception is thrown? How does the JVM handle the delegation of …
-
Make the Life of your Developer Client’s Easier with Smart Object Builders
Table of Contents The scenario: The complex objectThe traditional approach: Telescoping constructorsFavor Static Factory Methods over Class ConstructorsMany parameters? Use the Builder patternRestricts the order of method calls in the Builder patternConclusionKey TakeawaysFinal ThoughtsWe often hear the phrase: “Make the …
-
Exploring New Features in JDK 23: Null object pattern to avoid null pointer exception with JEP-455
Table of Contents Functional nature of the code and nullConclusionReferencesThe newest release JDK 23 [2] comes with a neat extension to pattern matching for switch and instanceof statements, JEP-455: Primitive Types in Patterns, instanceof and switch [1]. While the introduction …
-
How to Detect Cache Misses Using Observability
In this article, we’ll examine cache misses and, in general, learn about the caching concept and how to implement it in Spring Boot.
-
Increase readability and reduce complexity with Java’s Pattern Matching
Increase readability, reduce cognitive complexity, and avoid bugs that are hard to spot with Java’s Pattern Matching.
-
Busting Myths, Building Futures: A Conversation with Cay Horstmann on Java and Machine Learning
Cay Horstmann shares his experiences with Java, his writing process for technical books, the challenges of teaching Java, and discusses its role in education.
-
JDK Safari: How To Find Hidden Tools in the JDK
One of my hobbies is regularly searching the JDK for new Java classes with executable main methods.
-
Unusual Java: StackTrace Extends Throwable
While having a class that directly extends Throwable is surprising, it is allowed and is also useful for providing additional information.