Using Arthas for Java Debugging and Common Commands

This article demonstrates how to use Arthas, a popular diagnostic tool for Java appplications, to troubleshoot common production issues. We'll walk through a sample project with three problematic endpoints and then show how Arthas commands help identify and fix them. Setting Up a Demo Application First, create a Spring Boot application with thr ...

Posted on Wed, 15 Jul 2026 16:13:33 +0000 by marco839

Java Runtime Memory Behavior and Core Language Mechanics Explained

Object Arrays and Heap Allocation When declaring an object array like String[] arr = new String[5], the JVM allocates a contiguous block in the heap to store five references, not five String objects. Each reference is initialized to null. The array object itself — including its length metadata and reference slots — resides entirely on the heap. ...

Posted on Sun, 12 Jul 2026 16:15:27 +0000 by dvonj

Understanding the Static Keyword in Java Classes

Fields modified with the static keyword are known as static member variables or class variables. Fields without this modifier are instance variables. The primary distinction lies in memory allocation: static variables have a single shared copy across all instances, while instance variables have separate copies for each object. Static variables ...

Posted on Fri, 10 Jul 2026 17:46:57 +0000 by jimdelong

Java's Dual Execution Model and Core Syntax Essentials

Java's Compilation and Interpretation Hybrid Approach Java uniquely combines both compilation and interpretation methodologies. The distinction lies in translation timing: compilation converts entire source code upfront, while interpretation processes instructions line-by-line during execution. Consider this analogy: when a Chinese author write ...

Posted on Wed, 08 Jul 2026 17:33:41 +0000 by patriklko

Understanding Java Class Loading Mechanisms

Class loading is the first step in Java program execution. Understanding how classes are loaded provides insights into the JVM's operation and helps developers implement more efficient applications. Another important reason to study class loading mechanisms is to enable dynamic control over class loading, such as hot deployment, which enhances ...

Posted on Sat, 04 Jul 2026 16:39:25 +0000 by eyekkon

Understanding JVM ClassLoader Architecture and Delegation Mechanism

The ClassLoader in Java is responsible for loading class files, which contain a specific file identifier at their beginning. It loads the bytecode content into memory and converts it into runtime data structures in the method area. The ClassLoader only handles loading class files; whether they can be executed is determined by the Execution Engi ...

Posted on Thu, 02 Jul 2026 16:24:50 +0000 by oceans

Exploring Thread Visibility Issues in Java: Output Statements, Sleep, and Integer Operations

Java thread visibility issues can produce unexpected behavior when shared variables are accessed across threads without proper synchronization. This article examines three peculiar cases where programs behavee differently than expected due to JVM optimizations and memory visibility effects. Basic Visibility Problem Consider this simple program ...

Posted on Mon, 29 Jun 2026 17:28:12 +0000 by Fantast

JVM Memory Management: Primitive and Object Swapping Mechanisms

Primitive Data Type Swapping Consider this Java code example and its behavior: public static void main(String[] args) { int first = 10, second = 20; swapValues(first, second); System.out.println("first=" + first + ", second=" + second); } private static void swapValues(int x, int y) { int temporary = x; ...

Posted on Sun, 28 Jun 2026 17:39:22 +0000 by chomedey

Java Core Concepts: Methods, Scopes, and Object Lifecycle

Method Overloading Method overloading allows a class to define multiple methods with the identical name but distinct parameter signatures. This improves code readability for operations that are conceptually the same but handle different data types. public static float calculateMax(float valA, float valB) { return (valA > valB) ? valA : va ...

Posted on Sat, 27 Jun 2026 16:46:00 +0000 by anoopd

Understanding Java's Synchronized Mechanism: From Bytecode to Monitor Objects

Java Object Structure In the JVM, objects are organized into three memory regions: Object Header Mark Word: Stores object hash code, generation age, and lock status flags. This field is dynamically reused based on the object's state. Klass Pointer: A reference to the class metadata, enabling the JVM to determine the object's class. Instan ...

Posted on Wed, 24 Jun 2026 18:30:14 +0000 by gmcalp