[libxml-devel] [ libxml-Bugs-22513 ] Memory leak with Node.prev and Node.remove!

noreply at rubyforge.org noreply at rubyforge.org
Sat Nov 15 18:48:28 EST 2008


Bugs item #22513, was opened at 2008-10-22 08:42
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1971&aid=22513&group_id=494

Category: memory
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Nobody (None)
Assigned to: Nobody (None)
Summary: Memory leak with Node.prev and Node.remove!

Initial Comment:
Memory usage of Ruby increases when I execute a script like below. 
---
require 'xml/libxml'

doc = XML::Document.new()
doc.root = XML::Node.new('root')
root = doc.root
root << child = XML::Node.new('child')
(1..100000).each {|i|
  a = XML::Node.new('dummy')
  child.prev = a
  a.remove!
  if i % 100 == 0
    GC.start
    # show memory usage in unix environment.
    puts `ps alx | grep #{$$} | awk '{printf ("%d\t%s\n", $8,$13)}'`
  end
}

----------------------------------------------------------------------

>Comment By: Charlie Savage (cfis)
Date: 2008-11-15 16:48

Message:
Hmm, not seeing this on Windows.  Are you taking into account that memory usage will grow until a garbage collection happens?

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=1971&aid=22513&group_id=494


More information about the libxml-devel mailing list