Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

memusageinit Class Reference

#include <memusage.h>

List of all members.

Public Member Functions

 memusageinit ()

Friends

unsigned long memusage (const char **source)


Constructor & Destructor Documentation

memusageinit::memusageinit  ) 
 

Definition at line 20 of file memusage.C.

00020                            {
00021   if ( initialized == 0 ) {
00022     sbrkval = (unsigned long) sbrk(0);
00023     initialized = 1;
00024   }
00025 }


Friends And Related Function Documentation

unsigned long memusage const char **  source  )  [friend]
 

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 142 of file memusage.C.

00142                                             {
00143 
00144   unsigned long memtotal = 0;
00145   const char* s = "ERROR";
00146 
00147   if ( ! CmiMemoryIs(CMI_MEMORY_IS_OS) ) {
00148     memtotal = CmiMemoryUsage();  s = "CmiMemoryUsage";
00149   }
00150 
00151 #if defined(WIN32) && !defined(__CYGWIN__) && CHARM_VERSION > 60102
00152   if ( ! memtotal ) {
00153     memtotal = CmiMemoryUsage();  s = "GetProcessMemoryInfo";
00154   }
00155 #endif
00156 
00157   if ( ! memtotal ) {
00158     memtotal = memusage_proc_self_stat();  s = "/proc/self/stat";
00159   }
00160 
00161 #if CMK_BLUEGENEP
00162   if( ! memtotal) { memtotal = memusage_bgp(); s="mallinfo on BG/P"; }
00163 #endif
00164 
00165   if ( ! memtotal ) { memtotal = memusage_mstats(); s = "mstats"; }
00166 
00167   if ( ! memtotal ) { memtotal = memusage_mallinfo(); s = "mallinfo"; }
00168 
00169   if ( ! memtotal ) { memtotal = memusageinit::memusage_sbrk(); s = "sbrk"; }
00170 
00171   if ( ! memtotal ) { memtotal = memusage_ps(); s = "ps"; }
00172 
00173   if ( ! memtotal ) { memtotal = CmiMemoryUsage();  s = "CmiMemoryUsage"; }
00174 
00175   if ( ! memtotal ) s = "nothing";
00176 
00177   if ( source ) *source = s;
00178 
00179   return memtotal;
00180 
00181 }


The documentation for this class was generated from the following files:
Generated on Fri May 25 04:07:22 2012 for NAMD by  doxygen 1.3.9.1