TJBlackman
TJBlackmanā€¢2mo ago

Deno memory usage in Docker Container is crazy high...?

When I run Deno in Docker, Docker Desktop stats say it's using 144mb of memory, and NodeJS uses 11mb... Is this right?!?!? docker run -it --rm --name deno-process denoland/deno:alpine deno docker run -it --rm --name node-process node:22-alpine node
7 Replies
coty
cotyā€¢2mo ago
When I ran your commands they both used around 1Mb of mem. I don't see how yours could utilize such high mem when the only process started was sh
āžœ docker stats
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
542bf8aae8fc deno-sh 0.00% 268KiB / 2.574GiB 0.01% 746B / 0B 0B / 0B 2
e1d463642376 node-sh 0.00% 1.73MiB / 2.574GiB 0.07% 746B / 0B 1.7MB / 0B 1
āžœ docker stats
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
542bf8aae8fc deno-sh 0.00% 268KiB / 2.574GiB 0.01% 746B / 0B 0B / 0B 2
e1d463642376 node-sh 0.00% 1.73MiB / 2.574GiB 0.07% 746B / 0B 1.7MB / 0B 1
TJBlackman
TJBlackmanā€¢2mo ago
I typed node to start node or deno to start deno, but here are better commands: docker run -it --rm --name deno-process denoland/deno:alpine deno docker run -it --rm --name node-process node:22-alpine node And the stats I got on windows 11 (although im pretty sure docker runs via WSL2, Ubuntu22 in my case):
sh
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
c99768762c1b deno-process 0.00% 148.1MiB / 31.22GiB 0.46% 14.1kB / 3.76kB 0B / 0B 22
200bb84c4c50 node-process 0.00% 10.58MiB / 31.22GiB 0.03% 746B / 0B 0B / 0B 11
sh
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
c99768762c1b deno-process 0.00% 148.1MiB / 31.22GiB 0.46% 14.1kB / 3.76kB 0B / 0B 22
200bb84c4c50 node-process 0.00% 10.58MiB / 31.22GiB 0.03% 746B / 0B 0B / 0B 11
Just running Deno costs 148MB??? That sounds crazy high...
benjamn
benjamnā€¢2mo ago
A massive memory leak doesn't sound right. It might be reserving some memory for caching.
TJBlackman
TJBlackmanā€¢2mo ago
some
lol
bartlomieju
bartlomiejuā€¢2mo ago
You're running a REPL with this command. Deno REPL spawns an LSP instance for the REPL to provide auto completions and suggestions and the LSP eats a good chunk of memory. Try running a console log script and you'll get actual memory usage for programs
TJBlackman
TJBlackmanā€¢2mo ago
@bartlomieju You're a legend! Thanks for your time and feedback!
benjamn
benjamnā€¢2mo ago
Lol of course, it's the REPL! I've observed that before, but wasn't thinking right. šŸ¤¦šŸ¼ā€ā™‚ļø