-
-
Notifications
You must be signed in to change notification settings - Fork 902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apparent memory leak when duping DocumentFragment #1063
Comments
Also seen on ruby 1.9.3p448 and nokogiri 1.6.0. Second program (calls parse()) prints Valgrind results: Successful program (calls parse()): |
Some notes:
|
OK, this is because Suggestion: we could implement |
I've addressed this in MRI by copying nodes directly to the new Document. However, I'm having trouble with the java implementation. WIP is on branch Moved this into the 1.8.3 milestone, sorry for the delay. |
OK - I've got a second branch up in which I punt on trying to implement this optimization in the JRuby implementaiton. branch is |
…ment-fragment-attempt-2 fix #1063: poor memory performance when `dup`ing DocumentFragment
Ruby 2.1, Nokogiri 1.6.1
Title explains the issue I'm seeing. Here's a simple case to reproduce:
Memory usage goes from 11.9KB to 18.7KB. The contents of the fragment do not seem to matter but the bigger the fragment the bigger the leak (ran it with a large fragment and it peaked at > 1GB).
Having trouble with valgrind on OSX so unable to provide that analysis. It should be clear there's a problem if you run it. Compare to this example, which does not continue to eat up memory (from 11.12KB to 11.16KB):
Happy to provide more info if necessary.
The text was updated successfully, but these errors were encountered: