Valif
Member
|
600+ memory leak(s)
Hi,
I have been using esenthel for a while and starting to wrap up this project. Then stumbled upon a flag:"APP_MEM_LEAKS". This flag made my day BAD when I saw i had 600+ memory leak(s) upon closing the app. The project got pretty big, but not that big that it could cause 600 memory leaks.
While idling in the game, the memory doesn't raise automatically or when I delete the whole world and reload it the memory raises with around 8kb.
Someone experienced this many memory leaks or knows what is causing it?
Thanks in advance,
-Valif
|
|
06-13-2012 08:57 PM |
|
Tottel
Member
|
RE: 600+ memory leak(s)
It could be that you're not properly clearing your memory on application exit.
It's not a very clean way to do things, but those actually don't matter at all (since windows will re-assign the memory anyway). However, these also count as memory leaks to visual studio.
Other than that, I haven't noticed any memory leaks in the engine. Then again, I also haven't paid attention to them.
|
|
06-13-2012 09:35 PM |
|
Esenthel
Administrator
|
RE: 600+ memory leak(s)
you can always have only 1 error, which is called 600 times so no reason to panic
are you on Windows or Mac?
|
|
06-13-2012 09:38 PM |
|
Valif
Member
|
RE: 600+ memory leak(s)
I'm running on a Windows
|
|
06-13-2012 09:41 PM |
|
Esenthel
Administrator
|
RE: 600+ memory leak(s)
easiest way to get memory leaks is to not call
free/Free for malloc/Alloc
or delete for new
or delete[] for new[]
engine memory containers Memc,Mems,etc. are memory leak proof
best way is to comment out half of your code and do, as I like to call it - " Binary Bug Hunt ™ "
|
|
06-13-2012 10:37 PM |
|
Valif
Member
|
RE: 600+ memory leak(s)
Hehe, I'll try your " Binary Bug Hunt ™ " ;p
|
|
06-13-2012 11:00 PM |
|
Valif
Member
|
RE: 600+ memory leak(s)
Ok, found the source of the problem of the memory leaks. It was caused because i forgot to destruct Raknet
Thanks for helping!
|
|
06-14-2012 02:43 AM |
|