Open sethboyles opened 2 years ago
This is unfortunate. Both Oj and yajl are native extensions written in C, so there's not much MultiJSON can do about it here.
I recommend switching to a different adapter or stop using MultiJSON altogether as an option to remediate memory leaks.
Well I think the memory leak is only in MultiJSON, to clarify. Using OJ.dump seems fine. It's only when using Oj via MultiJSON that we witness the memory leak. Sorry if that wasn't clear.
In a Rails app serving JSON responses, we noticed the following memory leak:
Memory would not be freed when the request ended, and eventually we would have to restart our process. We noticed the same behavior when using yajl.
Bypassing MultiJSON entirely resolved the issue for us.
More details here: https://github.com/cloudfoundry/capi-release/issues/262#issuecomment-1218564266