SShortSingh.
Back to feed

Virtual Thread Pinning: How a Silent JVM Bug Caps Your App's Throughput

0
·4 views

Java's virtual threads, introduced via Project Loom, can silently revert to behaving like a bounded thread pool due to a phenomenon called 'pinning,' where a virtual thread cannot unmount from its carrier OS thread during a blocking operation. This occurs in exactly two scenarios: blocking inside a synchronized block (in JDK 21–23) and blocking within native or JNI frames, the latter remaining unfixed even in JDK 24. When pinning occurs repeatedly in a hot code path, all carrier threads — limited by default to the number of CPU cores — can stall simultaneously, causing scheduler starvation that mimics a deadlock from the outside. JDK 24 resolves the synchronized pinning issue by decoupling object monitors from carrier threads, but native frame pinning persists and can hide in unexpected places like static initializers. Developers are advised to audit blocking calls inside synchronized methods and third-party libraries, and use JVM diagnostics to detect pinning before it silently degrades throughput.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingHacker News ·

New Research Confirms Einstein's Relativity Shapes Chemical Bonds in Heavy Elements

New research from Brown University, published in July 2026, demonstrates that Einstein's theory of relativity plays a direct role in determining chemical bonding behavior in heavy elements. The study shows that as atomic number increases, electrons in heavy atoms move at speeds significant enough for relativistic effects to alter their energy levels and spatial distribution. These relativistic shifts influence how heavy elements form bonds, explaining certain anomalous chemical properties observed in metals like gold and mercury. The findings provide a clearer theoretical framework for understanding why heavy elements often behave differently from their lighter counterparts in the periodic table.

0
ProgrammingDEV Community ·

Developer builds automated WinPE deployment script to replace manual DISM commands

A developer at a company where third-party imaging tools are restricted turned the limitation into an opportunity by building a custom Windows deployment script from scratch. The solution, called deploy.cmd, consolidates disk partitioning, image application, and bootloader configuration into a single self-contained Batch script running within WinPE. To eliminate manual filename entry errors, the script dynamically scans a directory for .wim files and presents them as a numbered menu using delayed variable expansion. Diskpart instructions are generated on-the-fly into a temporary file, executed silently, and logged for troubleshooting, while bcdboot automatically configures UEFI boot files after imaging. The complete scripts have been published on GitHub for others facing similar enterprise environment restrictions.

0
ProgrammingDEV Community ·

Developer Builds Free AI-Powered RFP Compliance Checker Using Groq and Cloudflare

A developer built a browser-based tool that checks procurement bid responses against specification requirements, flagging compliant, partial, and missing clauses. The tool uses Groq's free-tier API running the Llama 3.3-70B model for inference, with a single Cloudflare Worker serving as the backend. No user accounts, databases, or stored data are involved, keeping ongoing infrastructure costs at zero. The most challenging aspect was engineering a prompt that reliably returns structured JSON across varied procurement document formats, solved by combining a strict JSON schema, explicit response formatting, and a near-zero temperature setting. The developer plans to release additional single-purpose procurement tools in the same series, with a plain-English bid-grader announced as the next project.

0
ProgrammingDEV Community ·

Rust Borrowing Explained: Immutable vs Mutable Access and Why It Matters

Rust's borrowing system controls data access through two forms: immutable borrows for read-only use and mutable borrows for exclusive write access. The core rule is straightforward — multiple readers are allowed, or one writer, but never both simultaneously. This design prevents common bugs such as accidental mutation, stale data reads, and race conditions that are frequent in languages like Python, Java, or C. The borrow checker enforces these access patterns at compile time, making code behavior predictable without requiring runtime checks. Rather than a restriction, Rust's borrowing model is intended as a safety-focused design tool that encourages developers to think clearly about data ownership and access lifecycles.