Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential memory leak when consuming for over a Month #337

Open
FransHeuvelmans opened this issue Aug 16, 2022 · 0 comments
Open

Potential memory leak when consuming for over a Month #337

FransHeuvelmans opened this issue Aug 16, 2022 · 0 comments
Labels
api: pubsublite Issues related to the googleapis/java-pubsublite-kafka API.

Comments

@FransHeuvelmans
Copy link

Hey java-pubsublite-kafka-team,

I noticed a potential memory leak in a heap dump of a long-running deployment of pubsublite-kafka). It occurred in a program which uses spring-kafka in combination with pubsublite-kafka to consume a stream of (Avro encoded) data. It might be that we simply do not use the API correctly or have another issue. We use Maven and it does not indicate any conflicting dependencies for pubsublite-kafka.

Problem: After running and consuming data for over a month, the wakeupTriggered Future is reported at a size of over 6 GiB in the heap dump (after analyzing with Eclipse MAT) for each Partition. The problem seems to be that ApiFuturesExtensions.whenFirstDone keeps adding Listeners but they are never GC-ed if the wakeupTrigger Future is never triggered. The analysis also shows that assignmentChanged has grown to a couple of MiBs because of Listeners, but it is nowhere near as big. I think it is being triggered every once in a while.

I’ve made a crude fix in a fork but it kind of breaks the wakeUp functionality so it is probably not a good solution. The big memory leak was gone after this fix (for us it works).

Sadly I can’t share the code of the program and I haven’t invested time in a minimal bug recreation. I understand if this is too little information to go on but I thought I'd report it.

Version info:
pubsublite-kafka: v1.0.0
Spring-kafka: 2.9.0
libraries-bom: 26.0.0
Java version: openjdk 11.0.16 2022-07-19
GC: Garbage-First (G1) Garbage Collector

@product-auto-label product-auto-label bot added the api: pubsublite Issues related to the googleapis/java-pubsublite-kafka API. label Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsublite Issues related to the googleapis/java-pubsublite-kafka API.
Projects
None yet
Development

No branches or pull requests

1 participant