You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
require 'nokogiri'
reader = Nokogiri::XML::Reader(File.open('5258513130_report.xml'))
i = 0
reader.each do |node|
i += 1
break if i == 5000
end
puts "it's time to dump the heap..."
sleep
as you can see from the following snapshots of the heap dump the reader is keeping in memory all the 5000 nodes it has found, this doesn't happen in MRI ruby 2.0.0p247
I have the following code:
5258513130.xml is
as you can see from the following snapshots of the heap dump the reader is keeping in memory all the 5000 nodes it has found, this doesn't happen in MRI ruby 2.0.0p247
nodeQueue.size = 5001
ReaderNode$ClosingNode 1249 instances
ReaderNode$ElementNode 1252 instances
ReaderNode$TextNode 2502 instances
my config:
nokogiri (1.5.10 java)
jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on OpenJDK 64-Bit Server VM 1.7.0_51-b00 +indy [linux-amd64]
The text was updated successfully, but these errors were encountered: