when looping through many web pages and calling something simple like below
manyhtmlpages.each do |page|
doc = Nokogiri::HTML(page)
puts doc.xpath("/html/body/h2[1]","/html/body/a[1]").to_s
end
i observe that memory consumption continually goes up until the script terminates due to running out of memory.
when i remove the doc.xpath bit, this error above is not experienced.