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
Memory leak in Node.js dev container #5767
Comments
I think I may have a clue. I left a container idle for a while and watched its memory consumption steadily increase. It looks to me like my VS Code server keeps spawning duplicate copies of one of its processes, and right now I have 66 of them running in an idle container: $ ps -ef | grep "Remote close with error" | grep -v grep | wc -l
66 Full output$ ps -ef | grep "Remote close with error" | grep -v grep
node 708 0 0 06:09 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 726 0 0 06:09 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 744 0 0 06:09 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 778 0 0 06:09 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 796 0 0 06:09 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 813 0 0 06:09 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 831 0 0 06:09 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 848 0 0 06:09 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 861 0 0 06:09 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 877 0 0 06:09 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 899 0 0 06:09 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 916 0 0 06:09 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 928 0 0 06:09 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 945 0 0 06:09 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 1101 0 0 06:09 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 1248 0 0 06:09 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 1597 0 0 06:09 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 1622 0 0 06:09 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 1786 0 0 06:10 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 2090 0 0 06:10 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 2290 0 0 06:11 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 2370 0 0 06:11 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 2458 0 0 06:11 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 2856 0 0 06:12 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 3376 0 0 06:12 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 3583 0 0 06:13 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 3794 0 0 06:13 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 3865 0 0 06:14 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 4045 0 0 06:14 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 4069 0 0 06:14 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 4155 0 0 06:15 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 4226 0 0 06:15 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 4253 0 0 06:15 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 4265 0 0 06:15 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 4281 0 0 06:15 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 12896 0 0 07:46 ? 00:00:04 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 12914 0 0 07:46 ? 00:00:03 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 14038 0 0 05:25 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 25105 0 0 05:47 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 25118 0 0 05:47 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 29079 0 0 05:54 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 29142 0 0 05:54 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 29158 0 0 05:54 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 29243 0 0 05:55 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 30041 0 0 05:58 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 30147 0 0 05:58 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 30285 0 0 05:58 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 30406 0 0 05:59 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 30568 0 0 05:59 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 30656 0 0 06:00 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 30716 0 0 06:00 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 30759 0 0 06:01 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 30807 0 0 06:01 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 30854 0 0 06:02 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 30900 0 0 06:02 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 31010 0 0 06:02 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 31148 0 0 06:03 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 31350 0 0 06:04 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 31836 0 0 06:06 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 32414 0 0 06:08 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 32441 0 0 06:08 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 32454 0 0 06:08 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 32474 0 0 06:08 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 32498 0 0 06:08 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 32514 0 0 06:08 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 32538 0 0 06:08 ? 00:00:00 /home/node/.vscode-server/bin/6cba118ac49a1b88332f312a8f67186f7f3c1643/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 45581 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
|
What is in the |
@chrmarti Here are the last ~150 lines or so, before that is just more repetition.
|
It looks like VS Code is closing the connection only to then reconnect again. Could you check if this also happens with VS Code Insiders? (https://code.visualstudio.com/insiders/) |
@chrmarti I gave this a try tonight. Only a few container hours so far, but things do seem better on Insider: $ ps -ef | grep "Remote close with error" | grep -v grep | wc -l
2 I didn't add any of my personal settings or local extensions to Insider, nor did I rebuild the container. Maybe let me know if you'd like me to try any of that, or if you think this just means it's an issue that's already been fixed. |
It might be fixed in VS Code, but it's hard to tell for sure as I haven't worked on any fixes there. Could you add your configuration to the Insiders install? You'll get the latest fixes with VS Code 1.62, but it would be great if we knew of any remaining issues before that is released. |
I'll give some of that a try, yep. Just so I better understand what to look for, could you confirm the number of expected processes matching the ones I've described above? Example behaviour in Insiders:
Assuming that's correct behaviour, and what I'm seeing is something like one process per currently forwarded port (even though every process appears to connect to the same port?), then at least I can specifically focus on trying to reproduce behaviours that violate this expectation. Also, when I tried Insiders, obviously it installed a newer remote server inside the container. When I reopen the container in regular VS Code, am I using the newer remote server? Or do the versions live side-by-side within the container, each using its own? I just want to make sure I nail this attempt at diagnosis. Thanks! |
@alexr00 Is VS Code still using the extension host connection for port forwarding or has that changed? (I thought there should be two underlying connections, one for the remote shared process and one for the extension host.) |
Since 1.61 port forwarding is done in the local shared process, but otherwise it uses the exact same mechanism as before. |
I'm sorry I was unable to get to this prior to your 1.62 release, our team was focused on a release of our own. I've upgraded to 1.62, deleted every container image and volume, and started from scratch. On first build, here are the long-lived processes I see running in the container: $ ps -efww
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 11:29 ? 00:00:00 /bin/sh -c echo Container started trap "exit 0" 15 while sleep 1 & wait $!; do :; done
node 11 0 0 11:29 ? 00:00:00 /bin/sh
root 23 0 0 11:29 ? 00:00:00 /bin/sh
node 123 0 0 11:29 ? 00:00:00 /home/node/.vscode-server/bin/b3318bc0524af3d74034b8bb8a64df0ccf35549a/node /tmp/vscode-remote-containers-server-708777f1b4be8ab3aafc9db8ee79c4b2dc34ee64.js
node 143 123 0 11:29 ? 00:00:00 sh /home/node/.vscode-server/bin/b3318bc0524af3d74034b8bb8a64df0ccf35549a/server.sh --log trace --force-disable-user-env --use-host-proxy --port 0 --extensions-download-dir /home/node/.vscode-server/extensionsCache --install-extension dbaeumer.vscode-eslint --install-extension eamodio.gitlens --install-extension esbenp.prettier-vscode --install-extension github.vscode-pull-request-github --install-extension mskelton.npm-outdated --install-extension redhat.vscode-yaml --install-extension richie5um2.vscode-sort-json --install-extension visualstudioexptteam.vscodeintellicode --start-server --disable-websocket-compression
node 146 143 4 11:29 ? 00:00:24 /home/node/.vscode-server/bin/b3318bc0524af3d74034b8bb8a64df0ccf35549a/node /home/node/.vscode-server/bin/b3318bc0524af3d74034b8bb8a64df0ccf35549a/out/vs/server/main.js --log trace --force-disable-user-env --use-host-proxy --port 0 --extensions-download-dir /home/node/.vscode-server/extensionsCache --install-extension dbaeumer.vscode-eslint --install-extension eamodio.gitlens --install-extension esbenp.prettier-vscode --install-extension github.vscode-pull-request-github --install-extension mskelton.npm-outdated --install-extension redhat.vscode-yaml --install-extension richie5um2.vscode-sort-json --install-extension visualstudioexptteam.vscodeintellicode --start-server --disable-websocket-compression
node 194 146 0 11:29 ? 00:00:03 /vscode/vscode-server/bin/linux-x64/b3318bc0524af3d74034b8bb8a64df0ccf35549a/node /vscode/vscode-server/bin/linux-x64/b3318bc0524af3d74034b8bb8a64df0ccf35549a/out/bootstrap-fork --type=ptyHost
node 312 0 0 11:29 ? 00:00:01 /home/node/.vscode-server/bin/b3318bc0524af3d74034b8bb8a64df0ccf35549a/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 36187 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 424 146 3 11:29 ? 00:00:17 /vscode/vscode-server/bin/linux-x64/b3318bc0524af3d74034b8bb8a64df0ccf35549a/node /vscode/vscode-server/bin/linux-x64/b3318bc0524af3d74034b8bb8a64df0ccf35549a/out/bootstrap-fork --type=watcherServiceChokidar
node 603 0 0 11:29 ? 00:00:01 /home/node/.vscode-server/bin/b3318bc0524af3d74034b8bb8a64df0ccf35549a/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 36187 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 736 146 3 11:29 ? 00:00:21 /vscode/vscode-server/bin/linux-x64/b3318bc0524af3d74034b8bb8a64df0ccf35549a/node /vscode/vscode-server/bin/linux-x64/b3318bc0524af3d74034b8bb8a64df0ccf35549a/out/bootstrap-fork --type=extensionHost --uriTransformerPath=/vscode/vscode-server/bin/linux-x64/b3318bc0524af3d74034b8bb8a64df0ccf35549a/out/vs/server/uriTransformer.js --useHostProxy= Identical processes 312 and 603 are the ones we have seen cause the memory leak when they start to replicate out of control. It might still be helpful if I understood why there appear to be two duplicates of this process, and the conditions under which it's expected to replicate further. I'm going to do a few hours of Gatsby dev now, which seems to trigger these issues most rapidly. I'll post separately with any observations. |
Okay, I managed to trigger the leak just now, on a relatively small scale. I ran After this, I checked and noticed an extra forwarding process had survived. Checking several times over the course of the next minute, here's exactly what I saw: $ ps -ef | grep "Remote close with error" | grep -v grep | wc -l
3
$ ps -ef | grep "Remote close with error" | grep -v grep | wc -l
3
$ ps -ef | grep "Remote close with error" | grep -v grep | wc -l
3
$ ps -ef | grep "Remote close with error" | grep -v grep | wc -l
3
$ ps -ef | grep "Remote close with error" | grep -v grep | wc -l
5
$ ps -ef | grep "Remote close with error" | grep -v grep | wc -l
5
$ ps -ef | grep "Remote close with error" | grep -v grep | wc -l
5
$ ps -ef | grep "Remote close with error" | grep -v grep | wc -l
7
$ ps -ef | grep "Remote close with error" | grep -v grep | wc -l
7
$ ps -ef | grep "Remote close with error" | grep -v grep | wc -l
7 This increase happened with one terminal open and no other tasks running. None of these additional processes ever closed; sitting here now about 10 minutes later, there are still 7 processes running. PIDs: $ ps -efww | grep "Remote close with error" | grep -v grep
node 7150 0 0 12:12 ? 00:00:03 /home/node/.vscode-server/bin/b3318bc0524af3d74034b8bb8a64df0ccf35549a/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 36187 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 7171 0 0 12:12 ? 00:00:05 /home/node/.vscode-server/bin/b3318bc0524af3d74034b8bb8a64df0ccf35549a/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 36187 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 31804 0 0 13:21 ? 00:00:00 /home/node/.vscode-server/bin/b3318bc0524af3d74034b8bb8a64df0ccf35549a/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 36187 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 31972 0 0 13:22 ? 00:00:00 /home/node/.vscode-server/bin/b3318bc0524af3d74034b8bb8a64df0ccf35549a/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 36187 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 31989 0 0 13:22 ? 00:00:00 /home/node/.vscode-server/bin/b3318bc0524af3d74034b8bb8a64df0ccf35549a/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 36187 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 32079 0 0 13:22 ? 00:00:00 /home/node/.vscode-server/bin/b3318bc0524af3d74034b8bb8a64df0ccf35549a/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 36187 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ???
node 32168 0 0 13:22 ? 00:00:00 /home/node/.vscode-server/bin/b3318bc0524af3d74034b8bb8a64df0ccf35549a/node -e ????const net = require('net'); ????process.stdin.pause(); ????const client = net.createConnection({ port: 36187 }, () => { ?????client.pipe(process.stdout); ?????process.stdin.pipe(client); ????}); ????client.on('close', function (hadError) { ?????console.error(hadError ? 'Remote close with error' : 'Remote close'); ?????process.exit(hadError ? 1 : 0); ????}); ????client.on('error', function (err) { ?????process.stderr.write(err && (err.stack || err.message) || String(err)); ????}); ??? Complete container log:
|
Going by the count of some of the log messages, it looks like the Docker CLI's process (docker exec) terminates while the process inside the container keeps running. I'll have to investigate if there is a way to detect that to verify this is true. |
I think i have a similar issue, one of my college use this extension, and
gives me multiple node processes running. Memory is slowly eaten. Is there any short term solution? I have no idea how this thing works on server/clientside. My first bet was kill all related processes. Maybe restarting some service helps? |
Developer: Reload Window in the command palette is the fastest way we've found to recover the memory. We lose about 30 seconds on window reload + 3-5 minutes restarting tasks. Better than rebuilds and all that! |
This looks like or is related to moby/moby#9098. We terminate |
@aaronadamsCA Could you give Remote-Containers 0.206.0 a try? (Currently requires VS Code Insiders.) |
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines. Happy Coding! |
@github-actions does not like vacations! @chrmarti, I gave this a go tonight. Findings when running
So it seems like it's still imperfect; at the same time it certainly seems to be better. The extra processes aren't always cleaned up right away, but there's at least a chance of eventual consistency, which is great. Your call whether you want to dig in any more, but I'm happy with this improvement and can keep an eye on things going forward after this update deploys to the entire team. |
I'm a bit surprised about the intermittently high number of processes. I wonder if that's because the connection to the Docker daemon goes over an unreliable network (e.g., when it is not on your local machine) and VS Code has to reconnect frequently or if something else is at work. Does the count always go down to 2 after a while? |
In Insider, so far it seems it does always go down to 2. It did get stuck at 7 in the example given, but then restarting and then killing the same tasks again took it back to 2. (In hindsight, the difference may have been killing the develop tasks while their browser tabs were still open vs. closed.) This is a local Docker container. Windows 11, WSL 2, Docker Desktop latest with WSL 2 engine enabled. I doubt this matters, but to run Gatsby sites in parallel in a dev container, you need to get a bit creative with ports, to ensure that both the dev servers (8000-8003) and Socket.io status sockets (40000-40003) are non-overlapping and reliably forwarded:
All 10 of these ports are defined in our "forwardPorts": [
8000, 8001, 8002, 8003, 8004, 40000, 40001, 40002, 40003, 40004
], Once I've got all 5 Process count remains at 2 this entire time. It's when I open, say,
This behaviour is fairly repeatable. So, yeah. It's weird! That's really all I can say. Would it help if I built a sample repository that exhibits this behaviour? |
If the browser tab keeps a connection open, that connection will show as an additional process in the count. (I just learned that these connections are not tunneled through the existing connections, but are separate.) So as long as the count goes back to 2 after you have closed the browser tabs (and any other application that might keep a connection open), we can consider the issue as fixed. |
Good to know! That answers my question about what drives the count itself, too, which will help me understand in case I observe further concerns. In other words, if I see the number elevated, it should mean an external process is holding connections open; if I kill the external process, the number should drop back to 2; if it doesn't, there's still a problem. So, I agree this is fixed! Really appreciate this, thank you. Our dev team will be pleased! |
Correct. Thanks! |
Hey there. I'm just posting a flag to follow this discussion. I have a memory leak in my Linux VM that I managed to locate in a devcontainer that is running node.js (a reveal-md devcontainer, and another JS devcontainer to manage techradars). |
@Karreg Maybe check if the latest versions (currently 0.208.0 - requires VS Code Insiders atm) improve anything. Please also open a new GitHub issue for the leak you see. It might well be a different problem than the one discussed here. Thanks. |
Our dev team uses a shared container definition. Developer platforms include Windows on x64, Mac OS on x64, and Mac OS on ARM. All platforms exhibit a shared behaviour: a memory leak that slows the dev environment. Each developer generally needs to reload the container window a few times a day to maintain responsiveness.
I am far from a Linux/Docker expert, so I am unsure how to narrow down where the memory goes. For now I've enabled Remote Containers trace logs and reloaded my window, and I figure I can post that log once consumption climbs back up.
Are there any other logs that could help, settings I should adjust, or things I could capture in a freshly reloaded window to compare to one whose memory consumption has exploded?
.devcontainer.json
Dockerfile
install.sh
The text was updated successfully, but these errors were encountered: