Closed
Description
Version
= 14
Platform
Linux::5.15.49-linuxkit
Subsystem
fs
What steps will reproduce the bug?
Create a container with disk size is 1m.
docker run --tmpfs /run:rw,noexec,nosuid,size=1024k --entrypoint bash -ti --rm node:20-buster
Create a file named test.js.
// test.js
const util = require('util');
const fs = require('fs');
const crypto = require('crypto');
(async () => {
while (true) {
try {
const content = util.format('%s%s\n', new Date(), crypto.randomBytes(1024 * 100).toString('hex'));
process.stdout.write(content, err => {
if (err) {
console.error(err);
}
});
} catch (e) {
// will print
// write error: Error: ENOSPC: no space left on device, write
console.error('write error: ', e);
}
await new Promise((resolve) => {
setTimeout(resolve, 100);
});
}
})();
Run it and rotate stdout to a file in the tmpfs.
node test.js > /run/test.log
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior? Why is that the expected behavior?
No response
What do you see instead?
It's the memory leak.
Additional information
No response
Metadata
Metadata
Assignees
Labels
No labels