memusageinit Class Reference

#include <memusage.h>

List of all members.

Public Member Functions

 memusageinit ()

Friends

unsigned long memusage (const char **source)


Detailed Description

Definition at line 15 of file memusage.h.


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 156 of file memusage.C.

00156                                             {
00157 
00158   unsigned long memtotal = 0;
00159   const char* s = "ERROR";
00160 
00161   if ( ! CmiMemoryIs(CMI_MEMORY_IS_OS) ) {
00162     memtotal = CmiMemoryUsage();  s = "CmiMemoryUsage";
00163   }
00164 
00165 #if CMK_BLUEGENEQ
00166   if( ! memtotal) { memtotal = memusage_bgq(); s="Kernel_GetMemorySize on BG/Q"; }
00167 #endif
00168 
00169 #if CMK_BLUEGENEP
00170   if( ! memtotal) { memtotal = memusage_bgp(); s="mallinfo on BG/P"; }
00171 #endif
00172 
00173 #if defined(WIN32) && !defined(__CYGWIN__)
00174   if ( ! memtotal ) {
00175     memtotal = CmiMemoryUsage();  s = "GetProcessMemoryInfo";
00176   }
00177 #endif
00178 
00179   if ( ! memtotal ) {
00180     memtotal = memusage_proc_self_stat();  s = "/proc/self/stat";
00181   }
00182 
00183   if ( ! memtotal ) { memtotal = memusage_mstats(); s = "mstats"; }
00184 
00185   if ( ! memtotal ) { memtotal = memusage_mallinfo(); s = "mallinfo"; }
00186 
00187   if ( ! memtotal ) { memtotal = memusageinit::memusage_sbrk(); s = "sbrk"; }
00188 
00189   if ( ! memtotal ) { memtotal = memusage_ps(); s = "ps"; }
00190 
00191   if ( ! memtotal ) { memtotal = CmiMemoryUsage();  s = "CmiMemoryUsage"; }
00192 
00193   if ( ! memtotal ) s = "nothing";
00194 
00195   if ( source ) *source = s;
00196 
00197   return memtotal;
00198 
00199 }


The documentation for this class was generated from the following files:
Generated on Tue Nov 21 01:17:19 2017 for NAMD by  doxygen 1.4.7