RFR: JMC-6556 JFR V1 Parser memory leak

Henrik Dafgård hdafgard at gmail.com
Mon Aug 26 15:57:08 UTC 2019


Hi all,

JIRA: https://bugs.openjdk.java.net/browse/JMC-6556

This fixes a small memory leak where the number of attributes added to a
StructContentType object grows unbounded while recordings are being parsed.

---
a/core/org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/internal/parser/v1/TypeManager.java
+++
b/core/org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/internal/parser/v1/TypeManager.java
@@ -116,7 +116,7 @@
  }

  // NOTE: Using constant pool id as identifier.
- private static final Map<Long, StructContentType<Object[]>> STRUCT_TYPES
= new HashMap<>();
+ private final Map<Long, StructContentType<Object[]>> STRUCT_TYPES = new
HashMap<>();

  private class TypeEntry {
  private static final String STRUCT_TYPE_CLASS = "java.lang.Class";
//$NON-NLS-1$


Cheers,
Henrik Dafgård


More information about the jmc-dev mailing list