Skip to content

Commit

Permalink
Merge pull request google#1382 from mtaufen/release-v0.23
Browse files Browse the repository at this point in the history
Cherry pick for Modify working set memory stats calculation
  • Loading branch information
vishh authored Jul 18, 2016
2 parents f4b4690 + bc757bc commit c2ea329
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions container/libcontainer/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,23 +387,16 @@ func toContainerStats2(s *cgroups.Stats, ret *info.ContainerStats) {
ret.Memory.ContainerData.Pgmajfault = v
ret.Memory.HierarchicalData.Pgmajfault = v
}
if v, ok := s.MemoryStats.Stats["total_inactive_anon"]; ok {
workingSet := ret.Memory.Usage

workingSet := ret.Memory.Usage
if v, ok := s.MemoryStats.Stats["total_inactive_file"]; ok {
if workingSet < v {
workingSet = 0
} else {
workingSet -= v
}

if v, ok := s.MemoryStats.Stats["total_inactive_file"]; ok {
if workingSet < v {
workingSet = 0
} else {
workingSet -= v
}
}
ret.Memory.WorkingSet = workingSet
}
ret.Memory.WorkingSet = workingSet
}

func toContainerStats3(libcontainerStats *libcontainer.Stats, ret *info.ContainerStats) {
Expand Down

0 comments on commit c2ea329

Please sign in to comment.