Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-30218

[Kafka Connector] java.lang.OutOfMemoryError: Metaspace

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.15.1
    • None
    • Connectors / Kafka

    Description

      Hello!

      I'm running a Flink application on AWS EMR which consumes from a Kafka Topic using the official Flink Kafka consumer. I'm running the application as a Flink batch job every 30 minutes and I see that the JobManager's metaspace is increasing every time I submit a new job and doesn't reduce once a job has finished executing. Eventually the metaspace overflows and I get a OutOfMemory metaspace exception. I've tried increasing the metaspace to 512m, but this just delays the problem - hence it's definitely a classloading leak.

      I debugged the issue by creating a simple Flink application with a Kafka consumer only and the issue still occurred, hence I suppose the issue is somewhere in the Kafka consumer. Only other third party plugin I was using when doing so was the AWS IAM Kafka dependency (software.amazon.msk:aws-msk-iam-auth:1.1.5). 

      I also tried debugging the issue by generating a heap dump as described here ([https://cwiki.apache.org/confluence/display/FLINK/Debugging+ClassLoader+leak|https://cwiki.apache.org/confluence/display/FLINK/Debugging+ClassLoader+leaks),] but I wasn't really able to spot the origin of the memory leak. I can see references to org.apache.kafka.common.utils.AppInfoParser$AppInfo though:

      I have attached the heap dump - if you need any more information from my set up feel free to ask, I can provide anything you need.

      Many thanks in advance! 

      Attachments

        1. dump.hprof.zip
          33.24 MB
          Lukas Mahl
        2. image-2022-11-25-15-55-43-559.png
          635 kB
          Lukas Mahl

        Activity

          People

            Unassigned Unassigned
            com98 Lukas Mahl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: