Skip to content
Snippets Groups Projects
MemWatch.h 892 B
Newer Older
  • Learn to ignore specific revisions
  • Lars Bilke's avatar
    Lars Bilke committed
    /**
    
    Lars Bilke's avatar
    Lars Bilke committed
     * Copyright (c) 2012, OpenGeoSys Community (http://www.opengeosys.org)
    
    Lars Bilke's avatar
    Lars Bilke committed
     *            Distributed under a Modified BSD License.
     *              See accompanying file LICENSE.txt or
    
     *              http://www.opengeosys.com/LICENSE.txt
    
    Lars Bilke's avatar
    Lars Bilke committed
     *
     *
    
    Lars Bilke's avatar
    Lars Bilke committed
     * \file MemWatch.h
    
    Tom Fischer's avatar
    Tom Fischer committed
     *
    
    Lars Bilke's avatar
    Lars Bilke committed
     * Created on 2012-05-07 by Thomas Fischer
    
    Tom Fischer's avatar
    Tom Fischer committed
     */
    
    #ifndef MEMWATCH_H_
    #define MEMWATCH_H_
    
    #ifndef WIN32
    
    #include <sys/types.h>
    #include <unistd.h>
    #include <iostream>
    #include <fstream>
    #include <string>
    #include <sstream>
    
    namespace BaseLib {
    
    class MemWatch {
    public:
    	MemWatch ();
    	unsigned long getVirtMemUsage ();
    	unsigned long getResMemUsage ();
    	unsigned long getShrMemUsage ();
    	unsigned long getCodeMemUsage ();
    
    private:
    	unsigned updateMemUsage ();
    	unsigned long _vmem_size;
    	unsigned long _rmem_size;
    	unsigned long _smem_size;
    	unsigned long _cmem_size;
    };
    
    }
    
    #endif // not Windows
    
    #endif /* MEMWATCH_H_ */