Author Archives: Stanislav_Panteleev

JVM.Interpreter.Does the JVM Reuse JIT-compiled Code Between Runs?

No — the JIT does not persist compiled code across program runs. Each time you start your program, the JIT compilation starts fresh — the JVM does not remember previously compiled hotspots from the last run. This is because JIT … Continue reading →

Posted in Без рубрики | Comments Off on JVM.Interpreter.Does the JVM Reuse JIT-compiled Code Between Runs?

JVM.Internals.What is the difference between the interpreter and the JIT compiler in the JVM?

The Interpreter and the JIT (Just-In-Time) Compiler are both part of the JVM’s Execution Engine, but they work in very different ways. Let’s break down the key differences:

Posted in Без рубрики | Comments Off on JVM.Internals.What is the difference between the interpreter and the JIT compiler in the JVM?

JVM.Internals.What are bytecode instructions, and how are they executed in the JVM?

What are Bytecode Instructions? Bytecode instructions are low-level, platform-independent commands that the Java compiler (javac) generates when you compile a .java file into a .class file. These bytecode instructions represent the logic of your program but in a format that … Continue reading →

Posted in Без рубрики | Comments Off on JVM.Internals.What are bytecode instructions, and how are they executed in the JVM?

JVM.Threads.Explain the role of the synchronized keyword in the JVM

The Role of the synchronized Keyword in the JVM The synchronized keyword in Java ensures thread safety by preventing multiple threads from accessing critical sections of code simultaneously. It is implemented at the JVM level using monitor locks (intrinsic locks).

Posted in Без рубрики | Comments Off on JVM.Threads.Explain the role of the synchronized keyword in the JVM

JVM.Threads.How does the JVM achieve thread safety for static variables?

How the JVM Achieves Thread Safety for Static Variables Static variables in Java are shared across all instances of a class, meaning multiple threads can access and modify them simultaneously. The JVM provides different mechanisms to ensure thread safety depending … Continue reading →

Posted in Без рубрики | Comments Off on JVM.Threads.How does the JVM achieve thread safety for static variables?

JVM.Threads.What are the common thread-related issues in JVM, and how can they be debugged?

1. Common Thread Issues & How to Fix Them 1️⃣ Race Conditions 🔹 What Happens? Multiple threads access shared data without synchronization, causing inconsistent results. Example: Expected: counter = 1000Actual: Might be lower due to lost updates. 🔹 How to … Continue reading →

Posted in Без рубрики | Comments Off on JVM.Threads.What are the common thread-related issues in JVM, and how can they be debugged?

JVM.Thread.How AtomicInteger works under the hood ?

How AtomicInteger Works Under the Hood AtomicInteger is a thread-safe, lock-free alternative to int that allows atomic operations without using synchronized or explicit locks. It relies on low-level CPU instructions (CAS – Compare-And-Swap) to ensure atomicity.

Posted in Без рубрики | Comments Off on JVM.Thread.How AtomicInteger works under the hood ?

JVM.Threads.What is thread contention, and how can it be minimized?

Thread Contention: What It Is & How to Minimize It 1. What Is Thread Contention? Thread contention occurs when multiple threads compete for shared resources, such as: CPU time Locks on synchronized blocks or objects Database connections Memory (heap or … Continue reading →

Posted in Без рубрики | Comments Off on JVM.Threads.What is thread contention, and how can it be minimized?

JVM.Threads.How does the JVM handle thread priorities?

JVM Thread Priorities: How They Work The Java Virtual Machine (JVM) assigns each thread a priority value (between 1 and 10) to influence scheduling, but the actual execution depends on the operating system’s thread scheduler.

Posted in Без рубрики | Comments Off on JVM.Threads.How does the JVM handle thread priorities?

JVM.Threads.What is the difference between a daemon thread and a user thread in JVM?

Daemon Thread vs. User Thread in JVM In Java, threads are classified into two types: User Threads (non-daemon) Daemon Threads Both types of threads execute in parallel, but the key difference is how they affect JVM termination.

Posted in Без рубрики | Comments Off on JVM.Threads.What is the difference between a daemon thread and a user thread in JVM?