Loading and unloading over and over causing iPad to crash

Previous topic - Next topic

Millerszone

My game has been running good until I started adding more graphics and sound.

First I was loading all game and menu graphics and sound at the start of the game but the game crashed.
So then I loaded sections of the game when needed, then unloaded when not needed. It worked o.k, but after
about 8 times of loading and unloading the game and menu, the game crashes.

So I made a program that that would just load all the game graphics and sound, after loaded, it would then
unloaded all graphics and sound, and put it in a loop with a counter. On the iPad it unloaded and loaded 11 times
and then crashed, same program on my PC, it loaded and unloaded 50 times and I quit the program. I was
watching the Windows Task Manager and I could see that the memory from the program was going up and down.

I'm using LOADSOUND "", 1, 1 ,  LOADSPRITE "", 1 to unload sprites and sound.

On PC with no graphics or sound loaded, the program was about 30Mb , with graphics and sound loaded the
windows task manager showed 165Mb.

Would really appreciate help so I could get my game submitted to apple.

Thanks
Hardware: iMac 27", MacBook Air, PC 3.5Ghz Quad
Developing Tools: GLBasic SDK, Gideros Studio, PureBasic
Developing for: iOS, Android, Windows, OS X, webOS, HTML5

Kitty Hello

Very strange. Try running with the tools to check for memory leaks in XCode. Maybe they show something?

Hark0

Hi!


I no unload any in my app on iOS when exit...

Any problem?

:P
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

blackway

Quote from: millerszone on 2011-Feb-04
My game has been running good until I started adding more graphics and sound.

First I was loading all game and menu graphics and sound at the start of the game but the game crashed.
So then I loaded sections of the game when needed, then unloaded when not needed. It worked o.k, but after
about 8 times of loading and unloading the game and menu, the game crashes.

So I made a program that that would just load all the game graphics and sound, after loaded, it would then
unloaded all graphics and sound, and put it in a loop with a counter. On the iPad it unloaded and loaded 11 times
and then crashed, same program on my PC, it loaded and unloaded 50 times and I quit the program. I was
watching the Windows Task Manager and I could see that the memory from the program was going up and down.

I'm using LOADSOUND "", 1, 1 ,  LOADSPRITE "", 1 to unload sprites and sound.

On PC with no graphics or sound loaded, the program was about 30Mb , with graphics and sound loaded the
windows task manager showed 165Mb.

Would really appreciate help so I could get my game submitted to apple.

Thanks


Hi millerszone!

Did you try to write another program but with loadsprite, unload sprite only? (no load sound, unload sound) ??
I feel that could be a problem with loadsound.
Cheers!


Millerszone

Quote from: Kitty Hello on 2011-Feb-04
Very strange. Try running with the tools to check for memory leaks in XCode. Maybe they show something?
Checked the running app with the the Xcode activity monitor. After load and unloading it wasn't releasing 4Mb
of memory.
I knew my sound files were about 4Mb, so I blocked the sound files from the code and re-ran the app, and
now the memory stays were it should.

"blackway", your right, it seems to be the LOADSOUND "", 1, 1 is not clearing the memory on the iPad.

For now, I'll keep all the sounds loaded.



Hardware: iMac 27", MacBook Air, PC 3.5Ghz Quad
Developing Tools: GLBasic SDK, Gideros Studio, PureBasic
Developing for: iOS, Android, Windows, OS X, webOS, HTML5

Kitty Hello

OK, I'll investigate on that. Thanks for the perfectly detailed bug inspection.

blackway

Quote from: millerszone on 2011-Feb-04

"blackway", your right, it seems to be the LOADSOUND "", 1, 1 is not clearing the memory on the iPad.

For now, I'll keep all the sounds loaded.

:good:

Did you check if you have randoms memory leaks when you play sounds in your game?? I remember a few memory leaks in Roll'n'Fall , maybe Gernot can check that too.

Bye!

Kitty Hello

Yes, memory was not freed. But! Overwriting a sound channel should not have leaked, but used the same memory again. No?