Skip to content

Memory leak with MultiJSON.dump #204

Description

@sethboyles

In a Rails app serving JSON responses, we noticed the following memory leak:

allocated by memory (61079397) (in bytes)
==============================
  61079397  /var/vcap/data/packages/cloud_controller_ng/46a8cc86e43a32e41d5b5e91e6983e75542ed547/gem_home/ruby/3.1.0/gems/multi_json-1.15.0/lib/multi_json/adapters/oj.rb:56

object count (1)
==============================
  1  /var/vcap/data/packages/cloud_controller_ng/46a8cc86e43a32e41d5b5e91e6983e75542ed547/gem_home/ruby/3.1.0/gems/multi_json-1.15.0/lib/multi_json/adapters/oj.rb:56

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: cloudfoundry/capi-release#262 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions