Hunting memory leaks

olive

Member
3rd Party Module Dev
Tutorial Author
Patreon Bronze
Joined
Jul 17, 2017
Messages
77
I'm trying to track down a slowdown that semi-consistently happens over tens of minutes of normal gameplay. I suspect a memory leak — the task manager shows that the executable's memory footprint gradually climbs & doesn't reset to starting when I null out the game and return to the main menu.

I recall that blitz had a command that printed out the current memory usage — is there anything like that in CX? It'd be nice to be able to print out memory usage before/after functions to try and track down the hypothetical leak.

Alternatively, are there any other techniques people have used to manage memory in their games? I'm using pooling for particles & have been thinking of trying to do the same for utilities like my Vector2, but I don't want to do that refactor unless it's likely to be useful.
 

Rich

Well-known member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
3rd Party Tool Dev
Joined
Sep 9, 2017
Messages
451
Unfortunately I cant help much but the only time my projects memory has ballooned is when Ive created images on the fly and forgot to discard them (Image.Discard) before nulling them, or creating or loading more.
 
Top Bottom