Tagged articles

Attach API

2 articles · Page 1 of 1
Architect's Guide
Architect's Guide
Sep 15, 2025 · Backend Development

How to Use Java Agents and Instrumentation for Non‑Intrusive Performance Monitoring

This article explains why inserting manual timing code is invasive, introduces the java.lang.instrument API, shows how to write a tiny Java Agent with premain and agentmain methods, demonstrates dynamic class redefinition via the Attach API, and explores how tools like Arthas and Bytekit leverage these mechanisms for runtime tracing and bytecode enhancement.

Attach APIInstrumentationJava Agent
0 likes · 19 min read
How to Use Java Agents and Instrumentation for Non‑Intrusive Performance Monitoring
Architect's Guide
Architect's Guide
Jul 4, 2023 · Backend Development

Using Java Agent and Instrumentation for Non‑Intrusive Method Timing and Tracing

This article explains how to replace invasive manual timing code with a lightweight Java Agent that leverages the java.lang.instrument API, ASM bytecode manipulation, and the Attach API to measure method execution time, perform dynamic class redefinition, and integrate with tools like Arthas for runtime tracing.

ASMAttach APIInstrumentation
0 likes · 22 min read
Using Java Agent and Instrumentation for Non‑Intrusive Method Timing and Tracing