Jump to content

Memory Leak


josk
 Share

Recommended Posts

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.

Elite Cobra Squad

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...