metaspace memory issue with class redefinition/retransformation 
search cancel

metaspace memory issue with class redefinition/retransformation 

book

Article ID: 383600

calendar_today

Updated On:

Products

DX Application Performance Management DX Operational Observability DX SaaS DX APM SaaS

Issue/Introduction

An application is failing due to the metaspace capacity reaching its limit wen DXAPM agent is enabled. The application functions normally without the DXAPM agent.

 

Environment

  • APM Agent Version : 23.*, 24.*, 25.*
  • PCF APM Agent version: javabuildpack 4.73

Cause

This is a JVM defect not a BRCM issue. Investigation # DE620718 - metaspace memory issue with class redefinition/retransformation 

The bug is related to retransformClasses in Instrumentation api ( Instrumentation::retransformClasses is a method in the Java Instrumentation API that allows you to redefine or retransform the bytecode of already-loaded classes at runtime, without unloading and reloading them. This method is commonly used in the context of Java agents, particularly for dynamic instrumentation of classes to modify their behaviour for monitoring, profiling, or debugging purposes.

The bug is impacting different java versions, here are some references: 1, 2, 3

Resolution

Upgrade to Java 22 or contact the JVM vendor for a fix.

Current Workaround from Broadcon DX APM JavaAgent side:

Disable the below settings in the Agent profile:

introscope.agent.deep.entrypoint.enabled=false
introscope.agent.automatic.backend.detection.enabled=false
introscope.agent.deep.instrumentation.visibility.processor.enabled=false

Additional Information