ohler55 / oj

Optimized JSON
http://www.ohler.com/oj
MIT License
3.12k stars 250 forks source link

BigDecimal 3.1 dependency brings excessive memory usage #907

Closed broksonic21 closed 5 months ago

broksonic21 commented 6 months ago

oj 3.1.2 is a patch version, but takes on a new dependency on BigDecimal 3.1. That version has significant memory issues -> we are unable to get any builds done with it due to https://github.com/ruby/bigdecimal/issues/222

Two things:

Thanks!

broksonic21 commented 6 months ago

Second related ticket: https://github.com/ruby/bigdecimal/issues/271

ohler55 commented 6 months ago

Oj has support BigDecimal since 2012 with version 1.2.10. Oj v3.1.2 was released in 2017. A change was made a few months ago to include the bigdecimal gem as a dependency as future version of ruby starting with v3.4 (I think) will be removed from the core. The current version of bigdecimal is 3.1.4 so Oj is dependent on the current version. Since Oj has been dependent on bigdecimal since 2012 spelling out that dependency explicitly in the gemspec did not seem like it warranted a minor version bump.

I'd be glad to relax the bigdecimal version dependency if that is needed. What version of the bigdecimal gem do you think is not buggy? v3.0 or further back to 2.x?

broksonic21 commented 6 months ago

On our end, we've had no issues with 3.0. 3.1 is where memory leaks and seg faults come in.

ohler55 commented 6 months ago

I can relax the requirement to

  s.add_runtime_dependency 'bigdecimal', '>= 3.0'

Does that work?

broksonic21 commented 6 months ago

on my end, yes - thanks!

broksonic21 commented 6 months ago

that lets everyone lock in on their own as needed with an appropriate 3.x version

ohler55 commented 6 months ago

I'll make a release tonight.

ohler55 commented 6 months ago

released