Newbie here, I have been experimenting a bit with Lua and the Middleclass library, an apparent memory leak with Middleclass has got me totally stumped. Is this really a leak or am I misunderstanding something.
I cut my code down to just the following lines
Code: Select all
require "middleclass"
local oPlayer = class("A Player") -- This single line is enough to show a leak
collectgarbage("collect")
local endMem = string.format("\nMemory used after Garbage Collect = %.1f kbytes", collectgarbage("count"))
print (endMem)
If I run this code repeatedly from a Lua console with dofile("myTest.lua") I get the following increasing memory usage.
Memory used after Garbage Collect = 43.8 kbytes
Memory used after Garbage Collect = 46.0 kbytes
Memory used after Garbage Collect = 48.2 kbytes
Memory used after Garbage Collect = 50.6 kbytes
If I add the line oPlayer = nil, that makes no difference either.
Reference: http://love2d.org/forums/viewtopic.php?f=4&t=2278
Hi
Newbie here, I have been experimenting a bit with Lua and the Middleclass library, an apparent memory leak with Middleclass has got me totally stumped. Is this really a leak or am I misunderstanding something.
I cut my code down to just the following lines
Code: Select all require "middleclass"
If I run this code repeatedly from a Lua console with dofile("myTest.lua") I get the following increasing memory usage. Memory used after Garbage Collect = 43.8 kbytes Memory used after Garbage Collect = 46.0 kbytes Memory used after Garbage Collect = 48.2 kbytes Memory used after Garbage Collect = 50.6 kbytes
If I add the line oPlayer = nil, that makes no difference either.