I'm trying to parse a large XML file with Nokogiri's SAX parser.
It works great when I read the same data from a file, but the memory goes to over 1GB when the data is read from Redis.
Here's the most basic code I can use to replicate the issue.
Any ideas why it's doing this?
class WordsList < Nokogiri::XML::SAX::Document
def start_element name, attrs = []
end
end
And here's how I'm loading it:
doc = WordsList.new
parser = Nokogiri::XML::SAX::Parser.new doc
parser.parse row_data
The row_data method is what gets the XML from Redis.
Thanks.