Skip to content

KSP memory leak in Android build #2073

@nico-gonzalez

Description

@nico-gonzalez

Hello! While investigating OOMs in our build we detected that heap space and metaspace is not being reclaimed after the build finishes, and mainly meta space keeps growing with each incremental build we run on both Gradle and Kotlin daemons.
It also seems that when ksp tasks run, the heap and meta space start to grow considerably

Is it possible that there is a memory leak somewhere in KSP?

Here's some info while running the heap dump through Eclipse MAT and Visual VM

Screenshot 2024-08-30 at 2 38 59 PM Screenshot 2024-08-30 at 2 39 13 PM Screenshot 2024-08-30 at 2 39 19 PM Screenshot 2024-08-30 at 2 45 26 PM Screenshot 2024-08-30 at 2 45 17 PM

I can share the heap dump if that's helpful. Let me know if you need anything else from my side to investigate this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions