GithubHelp home page GithubHelp logo

asoftco / leaky-gems Goto Github PK

View Code? Open in Web Editor NEW
900.0 131.0 21.0 15 KB

A list of Ruby gems that have known memory leaks (and issues)

License: MIT License

ruby ruby-on-rails rails memory-leaks gems rubygems memory-issues popcorn

leaky-gems's Introduction

A list of gems that have memory leaks

Links to issues, pull requests or articles demonstrating known memory leaks (gems are listed alphabetically):

Your Ruby app leaks memory if you see gems above in your Gemfile.lock. The list above may save you a week or more of your personal life.

A list of gems that have memory issues (but not actual leaks)

It appears some contributors submit gems with known memory issues, but not actual leaks. While those issues don't qualify as leaks they may still be important. I prefer listing them here to help other developers rather than just hiding them.

Links to known memory issues (gems are listed alphabetically):

Contributing

Feel free to submit a PR if you find any memory leaks in gems. The format is the following:

  • [leaky gem name and versions affected](link to confirm)

Thanks!

Contributors

Gem

After almost 4 years from the initial request a gem that checks Gemfile.lock for leaky gems has been created – https://github.com/rubymem/bundler-leak.

leaky-gems's People

Contributors

conzett avatar jpawlyn avatar juanignaciosl avatar lumir avatar oakesja avatar rrosenblum avatar sergey-alekseev avatar shaicoleman avatar vassilevsky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

leaky-gems's Issues

Method of checking?

Could you demonstrate or at least brief how did you test if those gems are memory leaky?

Current link to Sequel issue

Hi,

I just read linked issue for Sequel and person, which create it was using Sequel API in wrong way.
After some discussion they agreed about what was happend in his situation (behavior was expected) and how he should use API.

He also created pull request (already merged to docs) with information about using this API (for connect to database without pooling).

I think Sequel should be removed from list.

Different types of memory issues

There different types of memory issues from my POV:

  • memory leak which happens in C space - in extension or ruby implementation itself. Ruby is GCed so cannot see how you get memory leak in Ruby
  • memory bloat - when objects allocated and reference stored in global space, so they never can be GCed. Typically happens in memoization.
  • Useless gems. When useless gems loaded in application, so they take space, but do nothing.

And others, for which I haven't got a name. The question is: Is this repo appropriate for third type of issues?

Useless gems:

Memory bloat:

Maybe create a gem?

Do you think it is possible to create a gem to automatically check if you have a "leaky gem" installed?

I know that if you have a Gemfile it would be pretty easy to implement a command to check this. If you use Rails creating an initializer to do the same thing is also easy. But is it possible to check gem versions at "require" time?

Add openssl gem

[1] pry(main)> a=GC.stat[:total_allocated_objects]                                                                                                                                   
=> 2603020
[2] pry(main)> GetProcessMem.new.bytes.to_i                                                                                                                                          
=> 114798592
[3] pry(main)> 10_000_000.times.each { OpenSSL::Digest::SHA256.new("asdflasdfskj").hexdigest }
=> 10000000
[4] pry(main)> GC.stat[:total_allocated_objects]-a                                                                                                                                   
=> 50005694
[5] pry(main)> GetProcessMem.new.bytes.to_i                                                                                                                                          
=> 132751360

How do you verify the submitted gems to be truly leaky?

I had an impression that the list is fairly incomplete when I couldn't find rmagick in it, which is the canonical gem when we talk about colossal leaks, but then I realized that proving there's a memory leak in a gem is not easy, particularly when we have to narrow down to versions.

Do we have a methodological way to prove or disprove if there's a memory leak? Otherwise we'll end up with just blindly trusting the person who sends a pull request.

Maybe add axlsx to the list?

I'm not sure if this axlsx issue qualifies as a memory leak, but we've had some issues (crashing workers) with this gem due to the huge amount of memory it is known to use with large datasets. So maybe you'll want to add it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.