[release/1.0] cmd/containerd-shim: aggressive memory reclamation#2058
Conversation
To avoid having the shim hold on to too much memory, we've made a few adjustments to favor more aggressive reclamation of memory from the operating system. Typically, this would be negligible, on the order of a few megabytes, but this is impactful when running several containers. The first fix is to lower the threshold used to determine when to run the garbage collector. The second runs `runtime/debug.FreeOSMemory` at a regular interval. Under test, this result in a sustained memory usage of around 3.7 MB. Signed-off-by: Stephen J Day <[email protected]> (cherry picked from commit 0e8f084) Signed-off-by: Stephen J Day <[email protected]>
Codecov Report
@@ Coverage Diff @@
## release/1.0 #2058 +/- ##
============================================
Coverage 50.57% 50.57%
============================================
Files 81 81
Lines 7163 7163
============================================
Hits 3623 3623
Misses 2847 2847
Partials 693 693
Continue to review full report at Codecov.
|
|
Ok, we will test this. |
|
@stevvooe @Random-Liu @crosbymichael the records: the ps output:(It is 0.3% with top command) the top output:
the ps output: the top output: |
|
LGTM |
|
@yanxuean @miaoyq Let's do this:
If 2) doesn't show any significant cpu usage difference, we are good. But if 2) shows that the cpu usage of containerd-shim becomes significant, we may need to come back and tune the value here. |
|
Looks like this was in the 1.0.2 release could someone set the 1.0.2 milestone on this one? 🤗 🙏 |
|
Seems fine, but is the milestone reliable to report everything that went into a particular release? I don’t necessarily think so as it seems like for many fixes we simply set the cherry pick label and merge without setting the milestone (especially early in a cycle where we haven’t decided what/when about the next point release). |
To avoid having the shim hold on to too much memory, we've made a few
adjustments to favor more aggressive reclamation of memory from the
operating system. Typically, this would be negligible, on the order of a
few megabytes, but this is impactful when running several containers.
The first fix is to lower the threshold used to determine when to run
the garbage collector. The second runs
runtime/debug.FreeOSMemoryat aregular interval.
Under test, this result in a sustained memory usage of around 3.7 MB.
Signed-off-by: Stephen J Day [email protected]
(cherry picked from commit 0e8f084)
Signed-off-by: Stephen J Day [email protected]