EEEEEEEEEEYYYYYYYYAAAAAAAAAAAAAAA!!!!!!!!!!!

Published August 19, 2006
Advertisement
EYEYEYEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA! *SMASHSMASH*

EGAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!


TTTHHHHHHHHHHHHHPPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!!!!!!!!!!!!!

GOD I CAN'T FIND IT!!!

SOMEWHERE I have a memory leak, and I can't for the life of me track it down!

I'm working a bit on Squarediana Jones/SnakeEngine[Scarlet], and among one of them there is a very tiny memory leak, and it is driving me crazy!

Maybe I need better tools, but I don't know what.

Right now all I do is the lame bring up task manager and watch if memory usage goes up.

Once every few times I reload a level (the only level I currently have) memory usage goes up (4 - 8k).

I've tracked it down to when I create new Treasures and WhipHooks (they'll both do it).

Now I can't for the life of me find anything I'm newing and not deleting. I've tried using a giant picture for the sprite to see if that increases how much memory goes up, it doesn't change.

I've tried adding huge double arrays to the whiphooks/treasures themselves, doesn't change it (well, the initial memory usage is way higher, but the increase isn't changed).

I've tried adding huge double arrays to the sprite class, no change.

Basically all that I'm making are simple classes that have sprite classes. It's so simple I figured it would have to be in the Sprite class or Scarlet somewhere, but holy crap I don't know where.

Maybe adding giant arrays to things isn't the most elegant way of tracking down things like this, but I'm not sure what else to do...

So yeah, I'm at a loss
Previous Entry Journal eh?
Next Entry BOOOYAAAHHH!!!
0 likes 3 comments

Comments

Mushu
Its probably something like a copy constructor not correctly passing ownership of a resource, thus losing the handle on that memory handle.

Do your classes have raw pointers to memory allocated with new? Do all such classes have proper copy/assignment operators which will free the old stuff, etc, as necessary? This is especially required with using STL stuff, which very commonly call the copy constructor to move your stuff around in memory.
August 19, 2006 11:53 PM
Rixter
Could be, but now I added an inline function to my texture manager just to check how many textures were loaded, and now nothing works. Now classes with just primitives aren't being properly constructed, and they have empty constructors. I think god hates me.
If I ever get this figured out I'll look in to that though, thanks.
August 20, 2006 02:08 AM
Jotaf
I'm pretty sure there are utilities for Visual Studio that catch memory leaks, I just never used any of them because I never found a bug so crippling that I saw the need to do that. But yeah, you should try it, sorry I can't point you in the right direction though :)
August 22, 2006 07:58 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Spicy Curse

1168 views

Missile Command

1130 views

I wanna make games

1124 views

A letter

1192 views

End of Days

1260 views

Workin' Hard.

1000 views

Not much new...

1016 views
Advertisement