Search

Fast thread

Universal Java Thread Dump Analyzer

Tag

JVM

‘Troubleshooting Java’ book features fastThread

Laurentio Spilca, a Java and Spring expert, authored "Troubleshooting Java" to teach efficient code investigation, optimization, and bug fixing. The book includes techniques from basic debugging to advanced microservices methods. Notably, it demonstrates using the yCrash-fastThread tool for analyzing thread dumps, effectively diagnosing deadlock issues in Java applications.

Parallelism in ConcurrentHashMap

ConcurrentHashMap enhances multi-threaded applications through parallelism, introduced in Java 1.8. This allows problems to be divided into subproblems running across separate threads. Using the fork and join framework, methods like forEach can leverage this feature. While parallelism improves performance with numerous entries, its benefits are less noticeable with fewer records.

How Do Static Synchronized Methods Work in Java?

The post explains the behavior of static synchronized methods in Java, demonstrating how two threads can interact when trying to execute such methods simultaneously. It illustrates that a static synchronized method locks the class object, preventing concurrent access, while a non-static synchronized method allows simultaneous execution when threads lock different objects.

Can threads execute same synchronized method on different objects?

This post discusses the behavior of synchronized methods in Java, illustrating how multiple threads can invoke the same synchronized method on different objects simultaneously without contention. A demonstration program showcases this behavior, confirming no blocking occurs between threads, as each possesses a unique lock for the respective object. Further exploration of synchronized methods is encouraged.

Diagnose CPU spike  – non-intrusive approach!

This post outlines a non-intrusive method for diagnosing CPU spikes in production environments using the yCrash data script. It captures 360° data from JVM applications with minimal overhead and allows for analysis of CPU consumption by threads. The process includes data capturing, uploading, and generating a unified root cause analysis report.

Confoo 2023 – KNOWN JAVA APIs, UNKNOWN PERFORMANCE IMPACT!

ConFoo Montreal is a conference for developers, featuring global discussions on technology. Architect Ram Lakshmanan presented on the performance impacts of commonly used Java APIs. The session highlighted how these APIs can affect application performance, aiming to enhance developer awareness. Additional resources include a video link and shared slides.

Can threads execute different synchronized methods on same object?

This post explores the behavior of multiple synchronized methods in a Java object. It demonstrates through a program involving two threads that when one thread executes a synchronized method, the other thread is blocked from entering any synchronized method of the same object. Synchronization ensures orderly execution, preventing chaos.

Pitfalls to avoid when switching to Virtual threads

Java virtual threads, introduced in JDK 19, enhance application performance but have pitfalls. Avoid synchronized methods, as they prevent relinquishing OS thread control, suggesting ReentrantLock instead. Also, replace thread pools with Semaphore for limited backend calls and be cautious with ThreadLocal variables to prevent excessive memory usage when using many virtual threads.

Is Java Virtual Threads lightweight?

Java virtual threads can significantly reduce memory consumption and thread creation time compared to platform threads. While they consume less memory by utilizing Java heap memory, their execution time is tied to platform threads. Virtual threads enhance efficiency, particularly in applications with numerous threads or frequent creation, offering potential improvements in availability and throughput.

Up ↑