From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 12 03:10:31 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8AE11065679 for ; Mon, 12 Jul 2010 03:10:31 +0000 (UTC) (envelope-from dhruvakm@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 838788FC15 for ; Mon, 12 Jul 2010 03:10:31 +0000 (UTC) Received: by qwg5 with SMTP id 5so1463413qwg.13 for ; Sun, 11 Jul 2010 20:10:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=F6q4pdwUnFuEHmsB8fpEKOY6nr3g9fZ41UccVmxgQU4=; b=AiAOIs3l34rFJHi/moXLGmj9wGGpBdDmGmdYB+ctBw5d5rd+Mhbt/XirDR2Bg2m+Xa L7o/GYL0N6bza6DtgfbZ+jsEupb8utAPehzymonZuliaLygftcJUzfHYZFSTJCWOHyGN 1NkpaFaO+4YU2+k6nPpPat253SXckBR8I7fms= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=tyhE7pOpjWpVP/qrd1urI4J71HCEEyoeoS/D+mKpPoBTaZTBt62ADVvRdlnPmUZynt v7+53MXcmnd+sliaYhKKYvfJwthiQ2N328dW5XnCWK/0J3+ssKetJXSDAJrR3lSWpXdF ztiPzdkWGjoFwrpzwgBh/hVcHlpZrw3qBH+xQ= MIME-Version: 1.0 Received: by 10.224.35.229 with SMTP id q37mr7408657qad.323.1278904230575; Sun, 11 Jul 2010 20:10:30 -0700 (PDT) Received: by 10.229.220.16 with HTTP; Sun, 11 Jul 2010 20:10:30 -0700 (PDT) In-Reply-To: References: Date: Mon, 12 Jul 2010 08:40:30 +0530 Message-ID: From: dhruva To: FreeBSD Hackers Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: mallinfo equivalent on FreeBSD X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jul 2010 03:10:31 -0000 Hi, On Wed, Jun 30, 2010 at 12:49 PM, dhruva wrote: > Hello, > =A0I 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. > > 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. 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. with best regards, dhruva