High memory usage when using distroless/static build #188
-
Hi, When I use the distroless docker image or download the static build in the latest release (4.4.0) and run flood I experience high memory usage. Is this normal behaviour when going with distroless/static builds? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
By default, like all language runtime with JIT capabilities, Node runtime tries to utilize memory available to it to optimize the performance of the application. V8 engine reserves its own range of address spaces at launch. Such memory is neither allocated or committed. It will not block other programs from using the memory. You may check the real memory consumption with |
Beta Was this translation helpful? Give feedback.
-
I did a brief test on my machine. It turns out that I can successfully download a file (ubuntu-20.04.1-desktop-amd64.iso, 2.59GB) with
So, yeah, there is no need to worry about not-committed, not-allocated memory. It does not reflect the real memory consumption. If you are really paranoid about memory, use Docker's |
Beta Was this translation helpful? Give feedback.
-
Thank you for the detailed response and explanation. |
Beta Was this translation helpful? Give feedback.
By default, like all language runtime with JIT capabilities, Node runtime tries to utilize memory available to it to optimize the performance of the application.
V8 engine reserves its own range of address spaces at launch. Such memory is neither allocated or committed. It will not block other programs from using the memory.
You may check the real memory consumption with
sudo pmap -x <pid>
. It is also noticeable that the total memory available of your system will not decrease in that large amount.