In the handler, I load all scripts and minify them using AjaxMin, cache the result and output to the user. This lib is using almost 1GB of memory. I used .NET memory profiler and found a memory leak problem. The image with the results is attached.
Comments: ** Comment from web user: ronlo **
No, I haven't had a chance to work on this yet. So how are you using the objects? Are you caching a JSParser object or creating a new one every time? From the image, it looks like it's the scopes that are leaking -- scopes contain collections for the fields defined and referenced within them, and each field points to the lookup and vardecl nodes corresponding to the references/definitions. Those types of objects seem to be at the top of the list. The parser holds a reference to the global scope, so we need to make sure it gets cleared. Of course, each AST node references the parser so it can access the settings, so I wonder if there is a circular reference going on there.
Anyhow, I'll try to set up a process that just keeps minifying code over and over and see what leaks.