GetMemoryUsage
This function gets the current application memory usage. You can use this to check for memory leaks.
Due to the limitations of various platforms and the use of garbage collection, the value returned will not be perfectly accurate on all platforms. The application memory usage value can only be considered accurate in Microsoft Visual Studio when running in debug mode.
Syntax
Returns
Returns the current application memory usage. This value may be inaccurate on some platforms due to garbage collection.
Example
--Create a window
window = Window:Create()
context = Context:Create(window)
world = World:Create()
local camera = Camera:Create()
camera:SetRotation(35,0,0)
camera:Move(0,0,-2)
local light = DirectionalLight:Create()
light:SetRotation(35,35,0)
model = Model:Box()
model:SetColor(0.0,0.0,1.0)
while true do
if window:Closed() or window:KeyHit(Key.Escape) then return false end
model:Turn(0,Time:GetSpeed(),0)
Time:Update()
world:Update()
world:Render()
context:SetBlendMode(Blend.Alpha)
context:DrawText("Memory usage: "..System:GetMemoryUsage(),2,2)
context:Sync()
end