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

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


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

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


The documentation for this class was generated from the following files:

Generated on 8 Dec 2019 for NAMD by  doxygen 1.6.1