Skip to content


Subversion checkout URL

You can clone with
Download ZIP


jsdom memory leak? #122

jedahan opened this Issue · 3 comments

2 participants


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 , so its probably my fault, but I am having trouble profiling so I'm not sure where my memory leak is.


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.

@chriso chriso closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.