cpSpaceReindexShape leaking memory
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: cpSpaceReindexShape leaking memory
Hmm. Not sure why that would cause a memory leak off the top of my head. I'm on vacation this week, but left myself a TODO note to check it out when I get back.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: cpSpaceReindexShape leaking memory
Aha. So you are correct. So there are two trees, one for static shapes and one for dynamic ones. The trees are supposed to be sharing the dynamic trees pool of internal data structures, but it looks like when reindexing static objects it's creating a second unshared pool for the static tree. Looks like it shouldn't be too hard to fix.
The buffers are tracked, so at least it would free that memory when the space is freed. For a long running game that reindexed a lot of objects, it could waste a few megabytes of RAM though.
The buffers are tracked, so at least it would free that memory when the space is freed. For a long running game that reindexed a lot of objects, it could waste a few megabytes of RAM though.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
- slembcke
- Site Admin
- Posts: 4166
- Joined: Tue Aug 14, 2007 7:13 pm
- Contact:
Re: cpSpaceReindexShape leaking memory
Hah. So even worse than I thought, but very easy to fix. The fix is in the GitHub repository.
It was adding objects from the dynamic tree's pool to the static tree's pool and then NEVER USING THEM AGAIN. Oops. Hehe.
It was adding objects from the dynamic tree's pool to the static tree's pool and then NEVER USING THEM AGAIN. Oops. Hehe.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Who is online
Users browsing this forum: No registered users and 2 guests