-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
WHATWG URL Memory Leak #19019
Comments
It appears the related issue I linked deals with the WHATWG impl, where as node-mysql2 is using the original implementation. I'll see if I can swap it to the WHATWG and hopefully it will resolve it for me, but i'm a bit confused about what in the old implementation is leaking the strings since it's JS oriented. |
It appears I am using the WHATWG version in my applications code |
@aikar Could you provide a complete minimal testcase that reproduces this issue without |
The following testcase seems to reproduce the issue on v8.9.4 but not affect v9.5.0. const { URL } = require('url');
let i = 0;
function tick() {
const url = 'mysql://user:pass@host/db?debug=true&charset=BIG5_CHINESE_CI&timezone=-0700&rand=' + Math.random();
new URL(url);
if (++i % 1e6 === 0) console.log(i);
setImmediate(tick);
}
tick(); |
Sounds like the same issue as #17448. The fix for #17448, #17470, is included in:
|
Closing as fix has landed in 8.10 |
I've been debugging this issue: sidorares/node-mysql2#726
I'm confident the leak is in native land, as my heap grew over the weekend from 21.8MB to 22.0MB, comparing Heap Snapshots with the Chrome Inspector, shows no signs of a leak.
However the RSS of my process grew 240MB (in the course of the weekend)
I've narrowed the issue down to being related to the URL parsing of the Database DSN, as when I did a core dump of my leaking process,
I found my hostnames at 1.3 million instances of the string, and thousands to hundreds of thousands of various chunks of my DSN.
mysql2 lib does url parsing like so:https://github.com/sidorares/node-mysql2/blob/master/lib/connection_config.js#L167Seems pretty standard to me.edit: mysql2 notes not relevant, see below comments.
Related Issue: #17448
The text was updated successfully, but these errors were encountered: