Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

potential memory leaks in pmdaproc? #19

Closed
marcliangma7 opened this Issue May 7, 2015 · 4 comments

Comments

Projects
None yet
3 participants

Hi,

I'm using PCP to fetch processes info at 1 second interval. My PCP monitor (same host) is in Python using PMAPI (pmFetch). It worked well except I've noticed the RSS of pmdaproc process has increased from 944K to 5Mb in 4 days period. Is there a potential memory leaks in pmdaproc or I missed something? Thanks for your helps.

/proc/pmdaproc_pid/smaps: (heap size increases by 4 bytes every few seconds)
02416000-028c8000 rw-p 00000000 00:00 0 [heap]
Size: 4808 kB
Rss: 4732 kB
Pss: 4732 kB
Shared_Clean: 0 kB
Shared_Dirty: 0 kB
Private_Clean: 0 kB
Private_Dirty: 4732 kB
Referenced: 4732 kB
Anonymous: 4732 kB
AnonHugePages: 0 kB
Swap: 0 kB
KernelPageSize: 4 kB
MMUPageSize: 4 kB
Locked: 0 kB

Contributor

natoscott commented May 8, 2015

Which metrics? Is the issue reproducible by something as simple as "pmval -t 1 -i proc.psinfo.rss"?

I've not been able to reproduce it on master with the above, but that doesn't mean its not still a problem of course - a minimal test case would be helpful here.

Thank you for your reply. I'm reproducing with pmval and will update once it's done.

Here is the code sample for my monitor client:
...
metrics = ('kernel.all.uptime', 'kernel.all.nusers', 'kernel.all.load', 'proc.psinfo.pid', 'proc.psinfo.cmd', 'proc.psinfo.nice')
pmids = self.context.pmLookupName(metrics)
descs = self.context.pmLookupDescs(pmids)
result = self.context.pmFetch(pmids)
...
self.context.pmFreeResult(result)

Update:
I couldn't repro the issue by starting multiple pmval to collect 'proc.psinfo.pid', 'proc.psinfo.cmd' and 'proc.psinfo.nice' simultaneously. However, the issue still persists by using PMAPIs (pmFetch) to collect the metrics above. I can see heap size increases by 4 bytes every few seconds.

Could we please have the full python code? (email to kenj@kenj.com.au if that is easier)
The snippet above seems insufficient to reproduce the issue.

@natoscott natoscott closed this Jun 3, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment