josk Posted May 29, 2013 Share Posted May 29, 2013 Using System:GetMemoryUsage() it seems my game demo is increasing memory usage. If i use Aily's code from the other thread in my main loop and lower 80 to around 10 it seems to keep the usage low. I get the idea of garbage collector but don't really understand how it works. I would imagine its my code, I have looked at my code to see if I can spot any obvious errors. Any ideas what I should look out for? I thought it might be the sound loading as I had a Sound:Load in the main loop but changed that and no change. Quote Elite Cobra Squad Link to comment Share on other sites More sharing options...
steeleb Posted May 29, 2013 Share Posted May 29, 2013 Is sounds more like an inefficient garbage collector to me. Since the garbage collector does free the memory, when called manually. Memory leaks are bad with garbage collection schemes, because it can imply that the system is incapable of freeing some memory. Quote Link to comment Share on other sites More sharing options...
Josh Posted May 29, 2013 Share Posted May 29, 2013 The Lua garbage collector will run periodically when memory usage gets high. As long as its being regularly collected, your program is okay. I don't recommend calling the collector manually, except maybe if you are testing. 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.