Problem with libxml and Reader#expand not freeing memory

S

szimek

Hi,

I've already posted it to libxml-ruby tracker page, but I guess this
list is read by more people :)

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 and expand it with reader.expand:

reader.read # go to the first node
begin
node = reader.expand
import_data_to_db(node)
GC.start
end while reader.next != 0

The problem is that the memory allocated by objects created using
reader.expand is not freed till the reader is closed, which is
actually equivalent to parsing the whole file in memory, which
contradicts the whole idea of using pull parser.

Anyone had similar issue?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top