RFR: JMC-6556 JFR V1 Parser memory leak

Marcus Hirt marcus.hirt at datadoghq.com
Tue Aug 27 08:27:10 UTC 2019


LGTM! ;)

/M

On Mon, Aug 26, 2019 at 5:57 PM Henrik Dafgård <hdafgard at gmail.com> wrote:

> 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