-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Large memory leak caused by context.js's domains #1080
Comments
Using the following memwatch code in the example app: memwatch.on('leak', function(info) {
console.log('leak');
console.dir(info);
}); I ran the server and hit it with
Stats from
Funnily enough, heap growth is actually so fast that it overflows in |
raymondfeng
pushed a commit
that referenced
this issue
Feb 25, 2015
* Add a workaround to avoid conflicts with NewRelic (Raymond Feng) * Fix "User.confirm" to always call afterRemote hook (Pradnya Baviskar) * Skip hashing password if it's already hashed (Raymond Feng) * travis.yml: drop 0.11, add 0.12 and iojs (Miroslav Bajtoš) * Add docs for settings per #1069 (crandmck) * Fix change detection & tracking (Miroslav Bajtoš) * Minor doc fix (Ritchie Martori) * Upgrade jscs to ~1.11 via grunt-jscs ^1.5 (Miroslav Bajtoš) * Remove redundant dev-dep serve-favicon (Miroslav Bajtoš) * Fix test broken by recent juggler changes (Miroslav Bajtoš) * Fix coding style issue (Raymond Feng) * Remove trailing spaces (Raymond Feng) * Fix for issue 1099. (zane) * Fix API docs per #1041 (crandmck) * Fix API docs to add proper callback doc per #1041 (crandmck) * Fix #1080 - domain memory leak. (Samuel Reed) * Document user settings (Ritchie Martori) * Add wiki references to readme (Simon Ho)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This regression was introduced in ca0208d.
I am documenting as I go - this was causing large memory usage in my application that would eventually cause it to crash.
An example of its memory usage (I updated from loopback
2.8.4
to latest on Feb 1):To replicate this, clone loopback-example-app and run:
ab -n 1000 -c 10 "http://127.0.0.1:3000/api/cars"
Simple as that. It appears that the domain is not properly being torn down after the request has ended.
Here's a few snapshots of some heapdumps:
Here's the retainers (coming back to
currentDomain
). Note that this is a comparison between Snapshot 5 and Snapshot 6, so the listed items are those retained between the snapshots. All I did was run a thousand hits viaab
.The text was updated successfully, but these errors were encountered: