Mike Weiblen (mew++at++paradigmsim.com)
Mon, 29 Jun 1998 21:03:24 -0500
> 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
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:57:36 PDT