Bugs item #26297, was opened at 2009-06-20 11:38 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=26297&group_id=494
Category: memory Group: None >Status: Closed >Resolution: Accepted Priority: 3 Submitted By: Nobody (None) >Assigned to: Charlie Savage (cfis) Summary: Reader#expand leaking memory? Initial Comment: Hi, I'm trying to use libxml-ruby to parse ~250MB XML files. The files contain list of similar elements, so I'm iterating over each element doing reader.expand on it. The problem is that even if I run GC.start after expanding each element, the script eats up all available memory and eventually dies. It seems that the memory is freed up only on reader.close. Here's small test case - https://gist.github.com/3d3270abf62370317809 There are 3 scripts: the first one generates 2 XML files with list of nodes - shorter file (~100KB) has only one element in the list, longer one (~100MB) has 1000 elements. The second script parses short XML file 1000 times and uses constant amount of memory. The third script parses long XML file only once and uses up all available memory. ---------------------------------------------------------------------- >Comment By: Charlie Savage (cfis) Date: 2011-04-18 12:38 Message: Thanks for the report. This has been fixed in the latest release. Charlie ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1971&aid=26297&group_id=494 _______________________________________________ libxml-devel mailing list libxml-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/libxml-devel