Observability of the Java Virtual Machine

Image
The JVM is one of the most observable runtimes. It provides us lots of tools for troubleshooting a JVM application in production. 1. Thread observability Threads are how the JVM actually does work. When something is wrong in production, the symptom is almost always a thread: stopped, blocked, leaking etc. Thread dumps work on any JVM with no  instrumentation, no agents, no restarts. <Example project link with /threaddump endpoint>         // (1) Deadlock — two threads grab the same pair of locks in opposite order.         new Thread(() -> grab(LOCK_A, LOCK_B), "deadlock-A-then-B").start();         new Thread(() -> grab(LOCK_B, LOCK_A), "deadlock-B-then-A").start(); http://localhost:8080/actuator/threaddump To list the JVMS, we can use the command below. PS C:\observe-jvm> jps -lv 25296 jdk.jcmd/sun.tools.jps.Jps -Dapplication.home=C:\Program Files\Microsoft\jdk-21.0.3.9-hotspot -Xms8m -Djdk.module.main=...

Notes on Parallel Programming

In the past, the performance of microprocessors increased on average, 50% per year. In this period, you could simply wait to buy the next generation of microprocessors that will speed up your applications. But since 2002, single processor performance has slowed down. By 2005, most manufacturers decided to go on in the direction of paralellism. They started to put multiple processors on a single circuit.

But this does not magically improve the performance of serial applications. It may be a silly question to ask: why do we need ever increasing performance? But why do they manufacture multi-core hardware? Because as the speed of transistor increase, so does the power consumption. The circuit becomes too hot and is not reliable anymore. And if the integrated circuit industry stop producing new and better products, those companies dissapear. So today, CPU clock speed is not increasing, and manufacturers does not design complex processors.

Most of the time, it is not possible to automatically convert serial programs to parallel programs. We need to find better algorithms that use parallelism.

In the classical Von Neumann architecture, there is a CPU, a memory and the interconnection between them. The seperation of memory and CPU is a bottleneck. Today CPUs can execute instructions more than one hundred times faster than they can read items from main memory.

To be continued..

Comments

Popular posts from this blog

The WeakReference class, monitoring memory leak and garbage collection in a Java application

Simplescalar Simulator - Part 2: sim-outorder.c

Notes on Java Performance