Aily Posted May 29, 2013 Share Posted May 29, 2013 I found that Leadwerks2, Leadwerks3 and my own lua-driven projects eating memory. It grows each frame. After adding collectTime=collectTime-AppSpeed() if collectTime<0 then collectTime=60 collectgarbage('collect') end in main loop, seems like used memory stay same size, but "lags" became very visible on collecting garbage. Does anyone here thinking about it, and can make nice smooth results for garbage collecting in Lua? Quote "Better" is big enemy of "good" Link to comment Share on other sites More sharing options...
Aily Posted May 29, 2013 Author Share Posted May 29, 2013 My best soluton for now is local memoryUsed=math.ceil(collectgarbage("count")/1000) -- in Mb if memoryUsed>80 then collectgarbage('collect') end if used memory more than 80Mb - do garbage collection. Single lag per minute is not so visible Quote "Better" is big enemy of "good" Link to comment Share on other sites More sharing options...
YouGroove Posted May 29, 2013 Share Posted May 29, 2013 One more thing to drive us to full C++ projects. Just need a solid C++ game framework. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Josh Posted May 29, 2013 Share Posted May 29, 2013 It's best to just let Lua automatically run the garbage collector, rather than constantly calling it. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.