safeDelete problem with 1.4?
by Django Zeaman · in iTorque 2D · 10/21/2010 (10:33 pm) · 25 replies
We fixed the intro movie issue with 1.4, but now we noticed a new performance issue: some of our graphics aren't deleting properly, so we have memory creep and leaks with each wave. Our game, used to run for hours and hours, not it crashes after 40 waves.
Just wondering if anyone else is having any problems with graphics not releasing out of memory after switching to 1.4 from 1.3.
Just wondering if anyone else is having any problems with graphics not releasing out of memory after switching to 1.4 from 1.3.
About the author
I worked in learning simulations, then spent a few years working at Apple. I started to think about creating games for the iPhone and left to do that last summer. Our first game is coming out this summer.
Recent Threads
#22
There is plenty of code floating around on this forum for how to do this.
10/26/2010 (8:52 pm)
Agree with Craig there, I have init methods for my objects which are called when they come out of the pool. Also, very important to setDisabled(true) when you put them back.There is plenty of code floating around on this forum for how to do this.
#23
I made a test function that uses only 2 global variables and a schedule, and it crashes after 4 minutes of running only that while nothing else is working
it has made some objects but, it does not delete them or create anyone.
it does not even do a single new.
So, i think the problem is really a leak and not that you are doing things wrong.
I will open a new thread because is not fully related
01/20/2011 (7:56 am)
I think its not really a problem on how many objects and it just have a leak.I made a test function that uses only 2 global variables and a schedule, and it crashes after 4 minutes of running only that while nothing else is working
it has made some objects but, it does not delete them or create anyone.
it does not even do a single new.
So, i think the problem is really a leak and not that you are doing things wrong.
I will open a new thread because is not fully related
#24
01/25/2011 (7:47 pm)
I remember fixing a crash in iTgb for a friend and it seems that schedules will create some kind of memory leak. I didn't investigate why, I just simply told him to remove the schedule.
#25
If I hook the memory monitor from instruments up to it, it leaks memory rapidly and crashes almost immediately. If I just hook up the activity monitor, it's fine.
01/27/2011 (2:56 pm)
Is it actually crashing on device without having instruments hooked up to it?If I hook the memory monitor from instruments up to it, it leaks memory rapidly and crashes almost immediately. If I just hook up the activity monitor, it's fine.
Associate Craig Fortune
It is very easy to not fully clean an object before it is used again and you end up carrying on old data or behaviors from when it was previously used. This situation is when object pools are commonly referred to as "cesspools" :)