1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 Memory usage information for the process running this object.
31 Uses the information from /proc/\<pid\>/status
36 \*---------------------------------------------------------------------------*/
41 #include "OSspecific.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class memInfo Declaration
52 \*---------------------------------------------------------------------------*/
58 //- Peak memory used by the process (VmPeak in /proc/\<pid\>/status)
61 //- Memory used by the process (VmSize in /proc/\<pid\>/status)
64 //- Resident set size of the process (VmRSS in /proc/\<pid\>/status)
82 //- Parse /proc/\<pid\>/status
83 const memInfo& update();
87 //- Access the stored peak memory (VmPeak in /proc/\<pid\>/status)
88 // The value is stored from the previous update()
94 //- Access the stored memory size (VmSize in /proc/\<pid\>/status)
95 // The value is stored from the previous update()
101 //- Access the stored rss value (VmRSS in /proc/\<pid\>/status)
102 // The value is stored from the previous update()
108 //- True if the memory information appears valid
112 // IOstream Operators
114 //- Read peak/size/rss from stream
115 friend Istream& operator>>(Istream&, memInfo&);
117 //- Write peak/size/rss to stream
118 friend Ostream& operator<<(Ostream&, const memInfo&);
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 } // End namespace Foam
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 // ************************************************************************* //