KMemoryInfo
#include <kmemoryinfo.h>
Public Member Functions | |
KMemoryInfo () | |
KMemoryInfo (const KMemoryInfo &other) | |
quint64 | availablePhysical () const |
quint64 | buffers () const |
quint64 | cached () const |
quint64 | freePhysical () const |
quint64 | freeSwapFile () const |
bool | isNull () const |
bool | operator!= (const KMemoryInfo &other) const |
KMemoryInfo & | operator= (const KMemoryInfo &other) |
bool | operator== (const KMemoryInfo &other) const |
quint64 | totalPhysical () const |
quint64 | totalSwapFile () const |
Detailed Description
The KMemoryInfo class provides an interface to get memory information (RAM/SWAP).
To use the class, simply create an instance.
- Since
- 5.95
Definition at line 30 of file kmemoryinfo.h.
Constructor & Destructor Documentation
◆ KMemoryInfo() [1/2]
KMemoryInfo::KMemoryInfo | ( | ) |
KMemoryInfo Constructs a class with a snapshot of the state of the memory.
If an error occurs, a null object is returned.
- See also
- isNull.
Definition at line 52 of file kmemoryinfo.cpp.
◆ KMemoryInfo() [2/2]
KMemoryInfo::KMemoryInfo | ( | const KMemoryInfo & | other | ) |
KMemoryInfo Constructs a copy of the other memoryinfo.
Definition at line 62 of file kmemoryinfo.cpp.
Member Function Documentation
◆ availablePhysical()
quint64 KMemoryInfo::availablePhysical | ( | ) | const |
availablePhysical
The available memory is the free RAM without considering caches and buffers allocated by the operating system.
- Note
- You should always use this value to check if there is enough RAM for your data.
- Returns
- The memory available to the processes in bytes.
- See also
- freePhysical.
Definition at line 109 of file kmemoryinfo.cpp.
◆ buffers()
quint64 KMemoryInfo::buffers | ( | ) | const |
buffers
- Returns
- The size of RAM used as buffers in bytes. This value can be zero.
Definition at line 119 of file kmemoryinfo.cpp.
◆ cached()
quint64 KMemoryInfo::cached | ( | ) | const |
cached
- Returns
- The size of RAM used as cache in bytes.
Definition at line 114 of file kmemoryinfo.cpp.
◆ freePhysical()
quint64 KMemoryInfo::freePhysical | ( | ) | const |
freePhysical
The free memory is the amount of free RAM as reported by the operating system. This value is often tainted with caches and buffers used by the operating system, resulting in a low value.
- Note
- Don't use this value to determine if you have enough RAM for your data.
- Returns
- The free RAM reported by OS in bytes.
- See also
- availablePhysical.
Definition at line 104 of file kmemoryinfo.cpp.
◆ freeSwapFile()
quint64 KMemoryInfo::freeSwapFile | ( | ) | const |
◆ isNull()
bool KMemoryInfo::isNull | ( | ) | const |
isNull
- Returns
true
if the class is null, otherwisefalse
.
Definition at line 94 of file kmemoryinfo.cpp.
◆ operator!=()
bool KMemoryInfo::operator!= | ( | const KMemoryInfo & | other | ) | const |
operator !=
- Returns
true
if this memoryinfo is different from the other memoryinfo, otherwisefalse
.
Definition at line 89 of file kmemoryinfo.cpp.
◆ operator=()
KMemoryInfo & KMemoryInfo::operator= | ( | const KMemoryInfo & | other | ) |
operator = Makes a copy of the other memoryinfo and returns a reference to the copy.
Definition at line 67 of file kmemoryinfo.cpp.
◆ operator==()
bool KMemoryInfo::operator== | ( | const KMemoryInfo & | other | ) | const |
operator ==
- Returns
true
if this memoryinfo is equal to the other memoryinfo, otherwisefalse
.
Definition at line 73 of file kmemoryinfo.cpp.
◆ totalPhysical()
quint64 KMemoryInfo::totalPhysical | ( | ) | const |
◆ totalSwapFile()
quint64 KMemoryInfo::totalSwapFile | ( | ) | const |
totalSwapFile
- Returns
- The size of swap file in bytes.
- Note
- On an operating system where the paging file is dynamically allocated, this value can be zero when no memory pages are swapped.
Definition at line 124 of file kmemoryinfo.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Mar 30 2023 04:11:06 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.