Example program to show memory usage.  
More...
#include <string>
#include <iostream>
#include <iomanip>
#include <vector>
#include "JSystem/JShell.hh"
#include "JSystem/JSystemToolkit.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
 
Go to the source code of this file.
 | 
| int  | main (int argc, char **argv) | 
|   | 
Example program to show memory usage. 
- Author
 - mdejong 
 
Definition in file JMemoryUsage.cc.
 
      
        
          | int main  | 
          ( | 
          int  | 
          argc,  | 
        
        
           | 
           | 
          char **  | 
          argv  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Definition at line 20 of file JMemoryUsage.cc.
   30     JParser<> zap(
"Example program to show memory usage.");
 
   37   catch(
const exception &error) {
 
   38     FATAL(error.what() << endl);
 
   41   typedef long long int  data_type;
 
   43   const size_t size = size_B / 
sizeof(data_type);
 
   49     data_type* buffer = 
new data_type[size];
 
   53     for (
size_t i = 0; i != size; ++i) {
 
   91     for (
size_t i = 0; i != 
N; ++i) {
 
   92       buffer[i].resize(size / N);
 
Utility class to parse command line options. 
 
float getMemoryUsage(JShell &shell, const pid_t pid)
Get memory usage in percent of given process identifier. 
 
Auxiliary data structure for floating point format specification. 
 
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object 
 
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N