Date: Mon, 12 Jul 2010 14:12:32 +0930 From: "Daniel O'Connor" <doconnor@gsoft.com.au> To: dhruva <dhruvakm@gmail.com> Cc: FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: mallinfo equivalent on FreeBSD Message-ID: <44ECC517-F96D-4DA3-845E-61E2B5793BCC@gsoft.com.au> In-Reply-To: <AANLkTikXtHqCuRO3v9SUtplkGmwUA1dZyax66E5TL3hG@mail.gmail.com> References: <AANLkTimrqHm9_nHLCy0xRpf_h3kIttPHi746gkTKI2Re@mail.gmail.com> <AANLkTikXtHqCuRO3v9SUtplkGmwUA1dZyax66E5TL3hG@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 12/07/2010, at 12:40, dhruva wrote: > On Wed, Jun 30, 2010 at 12:49 PM, dhruva <dhruvakm@gmail.com> wrote: >> Hello, >> I would like to know the memory usage (total virtual memory) inside = a >> process and make decisions accordingly. >> To be more specific, I am using BerkeleyDB backed set or std::set = (C++ >> STL) depending on my current memory usage >> as my process will need to run in a resource constrained environment. >> By the way, this is user mode application. >>=20 >> Some things I am considering/tried: >> 1. GNU/Linux has mallinfo and I had my code working based on the >> information I get from the call. >=20 > Could anyone please help and throw some light on this topic (mallinfo) > equivalent. I am stuck and need > resolve this soon. In short, I need to find out the virtual memory > used (mapped to the process's address space) > in a light weight fashion so that I can make some decision based on = it. Can't you use getrusage to find that out? As for system wide stats, I think you could look at sysctl, specifically = the vm tree. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44ECC517-F96D-4DA3-845E-61E2B5793BCC>