Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Need strategy for finding memory leak

Author
Message
Eqqman
9
Years of Service
User Offline
Joined: 15th Jul 2015
Location:
Posted: 1st Apr 2017 18:44
I have a sequence where `main` calls `foo()` which calls `boo()` which calls `coo()`. When I run `main`, there is a memory leak caused by the foo->coo chain. I see this as the app starts taking up more and more memory each time the chain is invoked, and it quickly becomes unusable. If I comment out the call to coo(), the memory leak goes away, however, making a new test program where I call coo() directly from `main` doesn't cause a leak. The parameters of coo() include a UDT, but this is passed by reference. Does anyone have a strategy I could employ to try and figure out what exactly is causing the leak?
Goo Goo G\'Joob!
Markus
Valued Member
21
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 1st Apr 2017 19:11 Edited at: 1st Apr 2017 19:13
can you show code of coo() here ?

do you used #option_explicit
once at top in main?
AGK (Steam) V2017.02.28 : Windows 10 Pro 64 Bit : AMD (17.2.1) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd Apr 2017 16:55
Might not be the function itself, but whatever is calling coo() in your program. Perhaps it's being called more than it should be?

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
CJB
Valued Member
21
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 3rd Apr 2017 15:22
Are you creating anything within any of those functions (createsprite, createobjectbox etc.etc.)... If so, you need to keep track of the object ID created so that you either don't create the same thing again (only with a different ID) next time around, or so that you can successfully clean up when you've finished with whatever it is you created.

Like Marcus said, post up some code the highlights the problem, and we can help.

Login to post a reply

Server time is: 2025-06-06 16:41:48
Your offset time is: 2025-06-06 16:41:48