Skip to content

OOM issue with zgc #1133

Description

@teads-lionel-ngo

Hello there,

I am considering switching the gc used in production to zgc for my app but it constantly crashed with a OOM error. I have been actively chasing the root cause of the OOM and I believe there may be some issues when using pekko http with some garbage collectors.
To make it short, ZGC doesn't reclaim off-heap memory because my app has a fairly large heap with very moderate pressure. My app uses decodeRequest & encodeResponse.
For example, decodeRequest uses a GZipCompressor and from my understanding for every incoming request, it creates a new Inflater. The issue for my use case is that there is no explicit call .end() to properly release the resource leaving it to the garbage collector to reclaim it. Same goes for encoreResponse.
One workaround I found is using the flag ZCollectionInterval to force the gc to release off-heap memory but at the expense of CPU. I also tried to do a custom hacky decoderRequest and it also worked.

So here's my question: is it an intended behaviour in pekko http to let the gc handle this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions