With jsdom: true memory usage balloons to 1.4gb very quickly. By switching doing $ = cheerio.load data memory usage still goes up but at a much much lower rate. Maybe consider supporting cheerio.
My code is https://gist.github.com/3841073 , so its probably my fault, but I am having trouble profiling so I'm not sure where my memory leak is.
$ = cheerio.load data
I tried adding this.window.close() as per instruction in #62 before my @emit but that did not fix the memory leak.
using cheerio, the memory leak is gone.
so maybe remove support for jsdom, or figure out where to do window.close()? I had trouble figuring out where to do that.
Not sure what advice to give here. All of the created objects related to jsdom are exposed to the run() method so you'll need to look through it's documentation to find out how to reduce memory usage. jsdom is a bit of a memory hog from what I've heard - this is why it's not enabled by default. It does serve a purpose though - executing client-side JS and getting access to a proper selector engine (jQuery/sizzle) - so I don't plan on removing it.
Using cheerio has already been suggested (#103) and is TODO.