Skip to content

Memory leak in FieldBackedProvider #3294

@nyilmaz

Description

@nyilmaz

While using kinesis-logback-appender we come up with oom failures in our production applications. When we investigate heapdump, here what we found:

image

Seems FieldBackedProvider holds all request contexts of aws sdk's netty http client.

Also I reproduced the issue with my local environment.

logback config:

<appender name="KINESIS" class="com.gu.logback.appender.kinesis.FirehoseAppender">
    <bufferSize>1000</bufferSize>
    <threadCount>10</threadCount>
    <region>eu-west-1</region>
    <maxRetries>3</maxRetries>
    <shutdownTimeout>30</shutdownTimeout>
    <streamName>${STREAM_NAME}</streamName>
    <encoding>UTF-8</encoding>
  </appender>

opentelemetry version: 1.2.0

jvm params (result is the same with 256m Xmx):

-Xms256m
-Xmx2G
-XX:MetaspaceSize=128m
-XX:MaxMetaspaceSize=256m
-javaagent:/otel.jar
-Dotel.exporter.otlp.endpoint=http://main-collector.opentelemetry-operator-system.svc.cluster.local.:55690
-Dotel.resource.attributes=service.version=$APP_GIT_VERSION
-Dio.opentelemetry.javaagent.slf4j.simpleLogger.logFile=System.out

jvm:

openjdk version "16.0.1" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-16.0.1+9 (build 16.0.1+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-16.0.1+9 (build 16.0.1+9, mixed mode, sharing)

Container:

NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.12.7
PRETTY_NAME="Alpine Linux v3.12"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions