tanema / light_world.lua

A lighting model made for love 2d

Home Page:https://love2d.org/forums/viewtopic.php?f=5&t=78998

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This library take up too much memory

buckle2000 opened this issue · comments

with no object involves, only with ambient light {0,0,0}, this library's draw call takes up about 1500MB of memory.

You are welcome to open a pull request on how to solve it.

@tanema Do you know what uses the most memory? Or how to measure? I wouldn't know where to begin.

The problem is this function, it's creating a new Canvas everytime it's called which never gets garbage collected and fills up memory.

@tanema please re-open this issue.
@VideahGams do you know what this function is for? Redraw the canvas with given option (maybe shader)?
Will this help?
https://love2d.org/wiki/Canvas:newImageData

This is a huge issue. This basically means that a new canvas is created each frame.

@giann can you test that fix?