Discussion Forums  >  Crashes, Memory Warnings

Replies: 5    Views: 276

r0ckf3l3r
Aspiring developer
Profile
Posts: 5
Reg: Feb 11, 2013
Lisboa
1,150
10/22/13 02:12 AM (4 years ago)

App crash after sliding a few images (iOS)

Hi.


I'm having a little problem with a self-hosted app we've been doing here at the company.

The app uses the plugins "Screen Menu Buttons" and "Screen Images".
We've set it up so that the application launches with the bt_screen_menuButtons, displaying magazine covers that are clickable.

Each magazine cover will launch a bt_screen_images instance, which slides through the images.

We've used Instruments, and came to the conclusion that the app is taking up too much memory, eventually warning about memory ("BT_screen_images: didReceiveMemoryWarning"), and crashing with lots of pages active.

We searched the code, placed some breakpoints on it, and came to the conclusion that both the plugins never enter the dealloc stage, after being sent for release, which leaves us with the fact that the object count is higher than it should.

Since we're unexperienced, and this is happening inside the scope of two BuzzTouch plugins, I would like to ask for help on how to debug the situation.

How should I approach this problem?

Has anyone else had the same problem with those plugins?


Best Regards
 
SmugWimp
Smugger than thou...
Profile
Posts: 6299
Reg: Nov 07, 2012
Tamuning, GU
81,240
like
10/22/13 07:09 AM (4 years ago)
Put this into your plugin and see if it helps...

-(void)viewWillDisappear:(BOOL)animated {
[self.dealloc];
}

Cheers!

-- Smug
 
r0ckf3l3r
Aspiring developer
Profile
Posts: 5
Reg: Feb 11, 2013
Lisboa
1,150
like
10/22/13 10:08 AM (4 years ago)
Hi Smug,

Thanks for the answer.

I added [self dealloc]; to the viewWillDisappear of the Image Gallery Plugin. Unfortunately, invoking it kills the app as soon as I try to change back into the main view.

I've logged the retain count for some objects, and I'm getting the following value pattern:
When entering the app, screenData for the BT_screen_menuButtons gives a value of 11.
I then proceed into a magazine, invoking the BT_screen_images, and come back into the BT_screen_menuButtons. When I leave this screen to go into another magazine, I get a value of 19.

Every time I repeat the procedure described earlier, the screenData retain count goes up by 8 (11 at the beginning, 19, 27, 35) until it reaches 43 and stops the application with the memory warning, crashing it soon after.

I've been reading the code and (correct me if I'm wrong) screenData is a BT_item. It's value stems from the jsonData object.

Since my home screen doesn't change, shouldn't this retain count stay the same?


Best Regards,

r0ckf3l3r
 
SmugWimp
Smugger than thou...
Profile
Posts: 6299
Reg: Nov 07, 2012
Tamuning, GU
81,240
like
10/22/13 02:48 PM (4 years ago)
You can try it in a couple of other methods; I just thought viewWillDisappear might work.

You could try viewDidUnload...

Otherwise, I'm not an expert in memory management. Maybe when BT moves to ARC things will clear up a bit, but we're not there yet.

Cheers!

-- Smug
 
r0ckf3l3r
Aspiring developer
Profile
Posts: 5
Reg: Feb 11, 2013
Lisboa
1,150
like
10/23/13 04:01 AM (4 years ago)
I'll try it in some other methods, see what can be done.

The viewDidUnload suggestion will not work though. It's not being called as well.

I'll research a bit more into it, and let you know how it went.


Thanks for your help Smug.
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1691
Reg: May 01, 2011
Hopkins, Minnes...
26,110
like
10/23/13 09:45 AM (4 years ago)
It is hard to say when the new iOS core will be out, but I think I can safely say it will be a matter of weeks, not months. There is a meeting today on it with the developers and David.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.