Hi, Can I use DTrace to determine memory status? 1.Total Physical Memory, Used Memory. 2.Total Swap Space and Used Swap Space. I did find few DTrace scripts but had too much in them and I am unable to chop off unwanted lines of code due to lack of knowledge. It will be very helpful if some one can share the piece of code that serves my purpose as mentioned above. Regards, Ramesh. Ramesh Polepalli mFormation Technologies Inc. Direct Line: +91 80 6620 5939 Switchboard: +91 80 6620 5900 http://www.mformation.com Visit WWW.MFORMATION.COM and see how the MFORMATION SERVICE MANAGER can help you to transform your business.
Ramesh Polepalli wrote:> Hi, > > Can I use DTrace to determine memory status? > > 1.Total Physical Memory, Used Memory. > 2.Total Swap Space and Used Swap Space. > > I did find few DTrace scripts but had too much > in them and I am unable to chop off unwanted > lines of code due to lack of knowledge. > > It will be very helpful if some one can share > the piece of code that serves my purpose as > mentioned above.DTrace may be a hammer to your screw -- I''d suggest you look at tools better suited, such as vmstat or kstat. HTH Michael -- Michael Schuster Sun Microsystems, Inc. recursion, n: see ''recursion''
Ramesh Polepalli wrote:> Hi, > > Can I use DTrace to determine memory status? > > 1.Total Physical Memory, Used Memory. > 2.Total Swap Space and Used Swap Space. > > I did find few DTrace scripts but had too much > in them and I am unable to chop off unwanted > lines of code due to lack of knowledge. > > It will be very helpful if some one can share > the piece of code that serves my purpose as > mentioned above. > > Regards, > Ramesh. > >See sysconf(3C) [ use _SC_AVPHYS_PAGES, _SC_PHYS_PAGES] and swapctl(2); these calls in libc will do what you want. - Bart -- Bart Smaalders Solaris Kernel Performance barts at cyber.eng.sun.com http://blogs.sun.com/barts
*See script below for a detailed answer *. Beware that it may take time on a large memory footprint. mdb -k <<! ::memstat ! *Output will be similar to : *Page Summary Pages MB %Tot ------------ ---------------- ---------------- ---- Kernel 10270 80 8% Anon 43863 342 34% Exec and libs 6253 48 5% Page cache 2362 18 2% Free (cachelist) 64569 504 50% Free (freelist) 1866 14 1% Total 129183 1009 Physical 127322 994 regards <http://www.sun.com> *Benoit Chaffanjon* Sun Solution Center Customer benchmarking 12 Network Circle Menlo park CA 94025 - USA Office : 1 - (650) 786-6177 Cell : 1 - (510) 396-0104 Blog : http://blogs.sun.com/MrBenchmark "De la Tactique dans la Pratique" -Bourvil This email may contain confidential and privileged material for the sole use of the intended recipient. Any review or distribution by others is strictly prohibited. If you are not the intended recipient please contact the sender and delete all copies. michael schuster wrote:>Ramesh Polepalli wrote: > > >>Hi, >> >>Can I use DTrace to determine memory status? >> >>1.Total Physical Memory, Used Memory. >>2.Total Swap Space and Used Swap Space. >> >>I did find few DTrace scripts but had too much >>in them and I am unable to chop off unwanted >>lines of code due to lack of knowledge. >> >>It will be very helpful if some one can share >>the piece of code that serves my purpose as >>mentioned above. >> >> > >DTrace may be a hammer to your screw -- I''d suggest you look at tools >better suited, such as vmstat or kstat. > >HTH >Michael > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20070419/db553810/attachment.html>
This (newer) command option will show you what you need too: kstat -n system_pages Russ Ramesh Polepalli wrote:> Hi, > > Can I use DTrace to determine memory status? > > 1.Total Physical Memory, Used Memory. > 2.Total Swap Space and Used Swap Space. > > I did find few DTrace scripts but had too much > in them and I am unable to chop off unwanted > lines of code due to lack of knowledge. > > It will be very helpful if some one can share > the piece of code that serves my purpose as > mentioned above. > > Regards, > Ramesh. > > > > Ramesh Polepalli > > > > > > > > > > mFormation Technologies Inc. > Direct Line: +91 80 6620 5939 > Switchboard: +91 80 6620 5900 > > http://www.mformation.com > > > > > > > > > > > Visit WWW.MFORMATION.COM and see how the MFORMATION SERVICE MANAGER can help you to transform your business. > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org >
> Ramesh Polepalli wrote: > > Hi, > > > > Can I use DTrace to determine memory status? > > > > 1.Total Physical Memory, Used Memory./usr/bin/lgrpinfo -m 0 will do the trick on the recent OpenSolaris system. -- akolb