Jump to content
  • Advertisement
Sign in to follow this  
ddn3

Good way to track memory in Lua?

This topic is 3656 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've implemeneted an A* search in Lua, which was surpisingly easy, but it generates alot of garbage which causes Lua to stutter when it collect it. I can get around it by calling collectgarbage after the path finding, which collects it then, but it would be more useful if I could find the cause of this garbage and remove it in the first place. Is there a general method, library or patch for Lua which will allow me to track garbage generation on a line by line basiss ? Thanks again! -ddn

Share this post


Link to post
Share on other sites
Advertisement
Well I did find the source of the garbage, just to give people an update, if they are facing the same problem.

I just used blocks of gcinfo() calls and record the garbage mem per block, then using a simple binary search traced it down to the open list nodes which were being dumped per search iteration, i changed it to use a deadlist which puts all the dead open nodes into, and the garbage generated per search iteration dropped by a factor of 10 so thats good.

-ddn

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!