ruby-rdf / rdf-rdfa

Ruby RDFa reader/writer for RDF.rb.
http://ruby-rdf.github.com/rdf-rdfa
The Unlicense
35 stars 11 forks source link

Memory leak #5

Closed atd closed 13 years ago

atd commented 13 years ago

The following provokes a memory leak:

RDF::RDFa::Reader.new(URI.parse('http://www.aaronhockley.com/').open.read).statements.count

Using Ruby 1.8.7.302

gkellogg commented 13 years ago

I think you've found a loop trying to load profiles. You use the vcard profile, and this is what's likely screwing it up. I'll fix it shortly and get out an update.

BTW, you can load it more easily with the following::

g = RDF::Graph.load("http://www.aaronhockley.com/")
gkellogg commented 13 years ago

BTW, you can work around this bug, by reverting to RDFa 1.0 parsing, instead of RDFa 1.1. Try the following:

g = RDF::Graph.load("http://www.aaronhockley.com/", :content_type => "text/html", :version => :rdfa_1_0)
g.dump(:ntriples)
atd commented 13 years ago

Thank you for the quick work-arround

gkellogg commented 13 years ago

This should parse properly now with the default RDFa 1.1 profile.