Change oom metric to const

This removes the metric vec that was holding onto all task id and
namespace combinations forever, until containerd was restarted.  This
was causing a memory leak with many task.

This also removes the shim cmd where the `Args` is quite large from the
reaper after the shim has been started cutting down on another leak.

This is the first pass through the reaper but more code is required to
fix all the issues when commands are added.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2017-08-17 16:23:20 -04:00
parent 89daacfe3f
commit e800f08f9f
4 changed files with 39 additions and 11 deletions

View File

@@ -65,6 +65,7 @@ func (m *cgroupsMonitor) Monitor(c runtime.Task) error {
func (m *cgroupsMonitor) Stop(c runtime.Task) error {
info := c.Info()
m.collector.Remove(info.ID, info.Namespace)
m.oom.Remove(info.ID, info.Namespace)
return nil
}