YOUNSI RIADH
2008-Jul-11 14:10 UTC
[dtrace-discuss] About memory usage by a specific process
Hi Using vmstat I noticed that free memory is getting lower during a certain period of time (2 or 3 days) then that memory is recovered. Is there a dtrace script that would help to identify the process that uses that memory? Thanks Riadh YOUNSI -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20080711/79cb33f4/attachment.html>
prstat -s rss The RSS column is the resident set size, or roughly the amount of memory being used be the process. The "-s rss" tells prstat to sort based on rss size. HTH, /jim YOUNSI RIADH wrote:> > *Hi * > > *Using vmstat I noticed that free memory is getting lower during a > certain period of time (2 or 3 days) then that memory is recovered. Is > there a**_ dtrace script_** that would help to identify the process > that uses that** memory?** * > > ** > > ** > > *Thanks* > > ***Riadh YOUNSI* > > ------------------------------------------------------------------------ > > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org >
YOUNSI RIADH
2008-Jul-12 12:04 UTC
[dtrace-discuss] About memory usage by a specific process
Thanks Jim Prstat is useful for looking at what processes are using the memory. I am looking for the processes that use memory but do not release it Thanks Riadh -----Message d''origine----- De?: James.Mauro at Sun.COM [mailto:James.Mauro at Sun.COM] Envoy??: vendredi 11 juillet 2008 23:28 ??: YOUNSI RIADH Cc?: dtrace-discuss at opensolaris.org Objet?: Re: [dtrace-discuss] About memory usage by a specific process prstat -s rss The RSS column is the resident set size, or roughly the amount of memory being used be the process. The "-s rss" tells prstat to sort based on rss size. HTH, /jim YOUNSI RIADH wrote:> > *Hi * > > *Using vmstat I noticed that free memory is getting lower during a > certain period of time (2 or 3 days) then that memory is recovered. Is > there a**_ dtrace script_** that would help to identify the process > that uses that** memory?** * > > ** > > ** > > *Thanks* > > ***Riadh YOUNSI* > > ------------------------------------------------------------------------ > > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org >
Akhilesh Mritunjai
2008-Jul-13 13:36 UTC
[dtrace-discuss] About memory usage by a specific process
No direct way to do it. If you "know" when the memory usage rises, you already don''t need to use dtrace. Utility tools like vmstat, prstat and pmap can do the job for you. You may be just fine running "prstat -s rss -c 1 > prstat.out &" in a shell and leaving it there for few days, and then a little perl to find out who were top hoggers in last 2-3 days. After you have found the suspects, use libumem to find out if there is anything wrong with their memory allocation/deallocation or they are just need to use that much memory. Keep in mind that reported memory usage figures may be highly misleading. You need to account for things like shared pages and reservations. -- This message posted from opensolaris.org
So....if the RSS value of the process reaches a certain size and remains more or less at the same size (which is typically the case once a workload quiesces), are you saying to know specific processes should be releasing memory at some point? Why do you think the memory should be getting released - specific application code? Are these heap segments (I assume yes)? Chasing memory allocations and frees is doable, but not trivial. You can instrument malloc/free calls with the PID provider, or link to libumem.so, and use it''s feature set for debugging memory allocations with mdb. http://access1.sun.com/techarticles/libumem.html That aside, there are several more detailed responsed on using dtrace for chasing memory allocations and frees in the archives on the opensolaris.org page (discussions -> dtrace -> search). I would encourage you to make sure you have a good sense for what your chasing before you go down this path. It sounds almost like a memory leak, but you do not describe it as such. All I''m saying is have a good sense of the magnitude of the problem. If you''re looking for segments in the 100''s of MBytes or GByte range, you should be able to find those. But if you''re chasing a few megabytes here and there....you really need to be using a debugger and working with the folks that own the code. Good luck, /jim> Thanks Jim > Prstat is useful for looking at what processes are using the memory. > I am looking for the processes that use memory but do not release it > Thanks > Riadh >