In message <[EMAIL PROTECTED]>
        Dan Janowski <[EMAIL PROTECTED]> wrote:

> What I need now is a few concise examples that have blown up  
> previously. I am particularly looking for ones that just use the node  
> operations.

Attached is roughly the test case I was using when I was working on
this before - it broadly mirrors one things that the OpenStreetMap
site does when answering requests.

Basically it creates 100 GPX files, each with 10000 points in - in
real life each one would be streamed back to the client but in this
test we just go on to the next one.

With libxml-ruby 0.3.8.4 this grows rapidly to a resident size of
about 650Mb to 750Mb (total virtual size is about 50Mb more than
that) and with my patches it is stable at a resident size of
about 35Mb (about 95Mb total).

Tom

-- 
Tom Hughes ([EMAIL PROTECTED])
http://www.compton.nu/


require 'rubygems'
require 'xml/libxml'

100.times do
  doc = XML::Document.new
  doc.encoding = 'UTF-8'
  
  root = XML::Node.new 'gpx'
  root['version'] = '1.0'
  root['creator'] = 'OpenStreetMap.org'
  root['xmlns'] = "http://www.topografix.com/GPX/1/0/";
      
  doc.root = root
  
  track = XML::Node.new 'trk'
  doc.root << track
  
  trkseg = XML::Node.new 'trkseg'
  track << trkseg
  
  1.upto(10000) do |n|
    trkpt = XML::Node.new 'trkpt'
    trkpt['lat'] = n.to_s
    trkpt['lon'] = n.to_s
    trkseg << trkpt
  end
end
_______________________________________________
libxml-devel mailing list
libxml-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

Reply via email to