I made a small demo program and I've noticed the longer the program runs the more RAM it uses, I left it alone for a while and it reached 2.5Gb of memory usage. I link below a copy of the program with the fps reduced to 5 to slow the effects, if anyone can solve this problem that would be greatly appreciated.
(note: move the mouse left and right to see what the program does)
Memory leak problem
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Memory leak problem
love.graphics.newScreenshot and love.graphics.newImage are not designed for streaming. Calling them every update/draw is extremely inefficient.
You can force a garbage collection with collectgarbage to clean up the unused ImageData and Image immediately.
Code: Select all
function love.draw()
-- ...
screen = love.graphics.newScreenshot()
screen = love.graphics.newImage(screen)
end
Shallow indentations.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot], Semrush [Bot] and 2 guests