[MacRuby-devel] Nokogiri leaks

Guido Soranzio guido.soranzio at gmail.com
Sat May 28 07:13:56 PDT 2011

While experimenting with array controllers and NSTableViews, I was facing huge
memory leaks. I thought the culprits were the Cocoa bindings but I have discovered
that the Nokogiri gem is what is causing them.

The following little test doesn't leak under Ruby 1.9.2 compiled with MacPorts,
so it seems there is a problem with the underlying linking with libxml2 instead.

require 'rubygems'
require 'nokogiri'

loop do
 doc = Nokogiri::HTML('<html><body><p>TEST </p></body></html>')
 p = doc.css("p")[0].text
 print p


More information about the MacRuby-devel mailing list