Ensure that process.MemoryInfo returns a up-to-date value.

This commit is contained in:
choplin 2015-09-11 13:47:03 +09:00
parent 6bb6762470
commit cc3a104593
1 changed files with 4 additions and 0 deletions

View File

@ -153,6 +153,10 @@ func (p *Process) CPUAffinity() ([]int32, error) {
return nil, common.NotImplementedError return nil, common.NotImplementedError
} }
func (p *Process) MemoryInfo() (*MemoryInfoStat, error) { func (p *Process) MemoryInfo() (*MemoryInfoStat, error) {
_, _, err := p.fillFromStatm()
if err != nil {
return nil, err
}
return p.memInfo, nil return p.memInfo, nil
} }
func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) { func (p *Process) MemoryInfoEx() (*MemoryInfoExStat, error) {