GetProcessMemoryStats
Jump to navigation
Jump to search
This function returns a breakdown of the process memory usage. The reported numbers are always byte units and these numbers can be inaccurate.
Syntax
table|nil getProcessMemoryStats ( )
Returns
Returns a table if successful, otherwise returns nil
Property | Description |
---|---|
virtual |
total program size |
resident |
resident set size (memory in physical space/ram, also known as working set) |
shared |
size of resident shared memory (shared with other processes) |
private |
size of resident private memory (only for this process) |
Note: Resident set size should be roughly shared
+ private
from the table.
Example
This example will output the memory usage by the server process to the console every 5 minutes.
Click to collapse [-]
ServersetTimer(function() local div = 1024^2 local pmem = getProcessMemoryStats() if pmem then outputServerLog(("[SYS] %.2f MiB rss:%.2f MiB shr:%.2f MiB prv:%.2f MiB"):format( pmem.virtual / div, pmem.resident / div, pmem.shared / div, pmem.private / div )) end end, 5 * 60000, 0)
See Also
- addDebugHook
- base64Decode
- base64Encode
- debugSleep
- decodeString
- encodeString
- fromJSON
- generateKeyPair
- getColorFromString
- getDevelopmentMode
- getDistanceBetweenPoints2D
- getDistanceBetweenPoints3D
- getEasingValue
- getNetworkStats
- getNetworkUsageData
- getPerformanceStats
- getRealTime
- getTickCount
- getTimerDetails
- getTimers
- getFPSLimit
- getUserdataType
- getVersion
- gettok
- isTransferBoxVisible
- setTransferBoxVisible
- hash
- inspect
- interpolateBetween
- iprint
- isOOPEnabled
- isTimer
- killTimer
- md5
- passwordHash
- passwordVerify
- pregFind
- pregMatch
- pregReplace
- removeDebugHook
- resetTimer
- setDevelopmentMode
- setFPSLimit
- setTimer
- ref
- deref
- sha256
- split
- teaDecode
- teaEncode
- toJSON
- tocolor
- getProcessMemoryStats
- utfChar
- utfCode
- utfLen
- utfSeek
- utfSub
- bitAnd
- bitNot
- bitOr
- bitXor
- bitTest
- bitLRotate
- bitRRotate
- bitLShift
- bitRShift
- bitArShift
- bitExtract
- bitReplace