jruby icon indicating copy to clipboard operation
jruby copied to clipboard

How can I safely close a JRuby instance?

Open zhu956645239 opened this issue 3 years ago • 1 comments

Hello, good developers, after using JRuby, some static member attributes remain in memory, how to clean up all. Next I use MAT to analyze heap snapshots

image image

zhu956645239 avatar Mar 28 '22 02:03 zhu956645239

It seems like you are shutting things down correctly.

We do have a number of static, "effectively immutable" values sprinkled around JRuby, but I would not expect to see them be a problem from run to run (they would be reused once created).

However I also see globalRuntime retaining 1.4MB that should probably be cleanable (we will keep a global runtime active, but that should only happen if you request it). That might deserve some investigation in case we are creating it when we should not.

Can you help me understand how you are using JRuby in your app, so we might figure out why too much data is being retained?

headius avatar Mar 31 '22 23:03 headius