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?
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,
decodeRequestuses 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 forencoreResponse.One workaround I found is using the flag
ZCollectionIntervalto force the gc to release off-heap memory but at the expense of CPU. I also tried to do a custom hackydecoderRequestand it also worked.So here's my question: is it an intended behaviour in pekko http to let the gc handle this?