neography icon indicating copy to clipboard operation
neography copied to clipboard

I think we may have a memory leak

Open maxdemarzi opened this issue 11 years ago • 10 comments

Can we double check https://github.com/maxdemarzi/neography/blob/master/lib/neography/rest/node_paths.rb for a potential leak?

I'm getting reports of R14s on Heroku and the issue may be lots of "paths" being generated.

maxdemarzi avatar Mar 26 '14 02:03 maxdemarzi

See http://pastebin.com/2hkJ8LcJ

/Users/kwent/.rvm/gems/ruby-2.1.0/bundler/gems/neography-a4931670b7ff/lib/neography/rest/paths.rb String 16170

maxdemarzi avatar Mar 26 '14 02:03 maxdemarzi

Interesting. The two lines that stand out are:

/Users/kwent/.rvm/gems/ruby-2.1.0/bundler/gems/neography-a4931670b7ff/lib/neography/connection.rb          String                                                                                     17742

(17742 String objects in connection.rb)

and

/Users/kwent/.rvm/gems/ruby-2.1.0/bundler/gems/neography-a4931670b7ff/lib/neography/rest/paths.rb          String                                                                                     16170

(16170 String objects in paths.rb)

Any other concerns?

How can we recreate a similar log file with object counts? That 's useful during for debugging.

rdvdijk avatar Mar 26 '14 06:03 rdvdijk

I guess this StackOverflow issue is related?

rdvdijk avatar Mar 26 '14 09:03 rdvdijk

Yeah i opened this issue few days ago and was hopping to receive help without success :( .

kwent avatar Mar 26 '14 19:03 kwent

What if we refactor all those classes into modules?

That's my current plan I think...

maxdemarzi avatar Mar 27 '14 03:03 maxdemarzi

@maxdemarzi What would that fix? I think we should first identify what the exact problem is. What are all those String objects?

rdvdijk avatar Mar 27 '14 06:03 rdvdijk

I presume you've already seen this. https://github.com/mperham/sidekiq/issues/1421#issuecomment-33746157

mperham avatar Mar 27 '14 20:03 mperham

Yes. But even running on Ruby 2.0.0, we noticed memory leak.

kwent avatar Mar 27 '14 21:03 kwent

Latest dump => http://pastebin.com/VBPaV5mD

So it looks like it may not be the Rest class at all, but something borked with the "Phase 2" functionality.

maxdemarzi avatar Mar 27 '14 21:03 maxdemarzi

Any update on this?

steveodom avatar Aug 19 '14 23:08 steveodom