Re: shared arena size

New Message Reply Date view Thread view Subject view Author view

Mike Weiblen (mew++at++paradigmsim.com)
Mon, 29 Jun 1998 21:03:24 -0500


jurya%EWW1.EDW++at++mhs.elan.af.mil wrote:

> What do I do to see how much shared arena memory I am actually using
> versus the amount allocated?
>
> Thanks.
> ----------------------------------------------------
> Angela C Jury
> 412 TW/EWWS
> Edwards AFB, CA 93524
> phone: 805.277.5214
> email: jurya%eww1++at++mhs.elan.af.mil

Here's a snippet to query memory consumption from heap or arena.

Cheers
-- mew

/* $Id: memuse.c,v 1.1 1998/03/29 01:12:38 mew Exp $ */
/* Query the application's memory utilization */

#include <sys/types.h>
#include <malloc.h>
#include "tectonics.h"

int
BytesUsedHeap( void )
{
    struct mallinfo mi;

    mi = mallinfo();
    return( (int)(mi.usmblks + mi.uordblks) );
}

int
BytesUsedArena( void *arena )
{
    struct mallinfo ami;

    if (arena == NULL) return( 0 );
    ami = amallinfo( arena );
    return( (int)(ami.usmblks + ami.uordblks) );
}

-- 
Mike Weiblen                  talkto:972-960-2301 x292
PARADIGM Simulation, Inc.     faxto:972-960-9049
14900 Landmark, Suite 400     mailto:mew++at++paradigmsim.com
Dallas TX 75240               http://www.paradigmsim.com
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/
            Submissions:  info-performer++at++sgi.com
        Admin. requests:  info-performer-request++at++sgi.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:57:36 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.