Shoebox memory leak

Previous topic - Next topic

ampos

I am also in "resources in a showbox". Although on iphone it could not be a problem to have them in separate files in /media, in other plataforms it could not be a good idea.

Now you have to test it on Win & Mac at least :)
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Crivens

I would mostly agree, but it is a good point about users changing the look of your app easily. Infact without shoebox my app would be easy to add your own levels (could do simple validation i guess) as it's a little twist on the common slider puzzle. Nice easy one for a first app really.

Out of interest say I decide to abandon shoebox for an update and use individual files. How do I then remove the old shoebox? It is in the media directory which means it cannot be removed by my app. Would be great if the memory leak was fixed though...

Oh and just now my first app (Rotaslider) went onto the store! Whoop! Thanks to Gernot for this excellent language! Really quite chuffed now. :)

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

erico

don't forget to post it on the appropriate threads...we all would like to have a beek! =D

open gfx where levels can be made can be a "feature" for the more advanced user while you create a map editor or something like that, try the best to use what is available to your advantage!

good luck!

Crivens

Will post on the app store thread soon.

Yeah I know what you mean, but with plans to use online high scores in the future i would rather not let them have that feature. Plus I wanted to have that feature properly in the future once a lib appears to access the iOS camera or photos. Heh, the amount of bugs that a client has wanted kept in as it works as a good "feature" is always funny to me over the years. I program travel reservation systems and it is always a weird thing that they use in a clever way to allow something else.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Ian Price

RotaSlider=Bought =D

Good luck with it.
I came. I saw. I played.

Crivens

Ooh ta! Hope you like it! Hopefully Gernot can fix that memory leak for shoeboxes and I will do an update. Then I want to get Bluetooth working properly. It was 90% there but I wanted to get it on the store first.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Crivens

Gernot, do you think you will be looking to fix the iOS shoebox memory leak soon? If not then isn't the end of the world but I was hoping to keep it using it instead of allowing the images to be freely accessible. Isn't the best with my game where you can basically easily make your own level if you have access to the individual images (using iPhone explorer for example).

Out of interest if I abandon Shoebox then on the next update I include all the media rather than just the shoebox, then the memory leak should be fixed, but what happens to the shoebox that got transferred to the iPhone with the first release? It can't be deleted by my app I take it, so will I just have to leave it there?

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Kitty Hello

I "think" the update will wipe the old program, leaving only the documents directory and write the new version.

Can you check with the task manager if the memory rises on win32? Here it didn't, which makes be believe there's something seriously bronken with my iPhone memory management.

Crivens

But this would be the old shoebox not the actual program. Or are you saying the media is erased and redelivered each update so if removed the shoebox for the update and just used media then the shoebox would bs removed from the phone and replaced with the media?

Memory management is fine on my pc but then I don't have a graphics card that allows me to view the amount of memory that the video card is using up. I think so far the iPhone memory management is fine with normal sprites but anything from the shoebox will not clear properly.

While I've got your attention then any chance of a change to loadsprite to load things in at a set pixel or percentage size (both x and y separate)? This way one sprite can be used for any resolution at a set ratio without impacting performance or memory like zoomsprite will. I posted some code to do it yourself but I would prefer it inbuilt as it doesn't support partially transparent sprites (alphablended is it?) plus it would be better loaded into memory directly.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Kitty Hello

No video memory leaks. It's the shoebox data.

You can either stretch sprites yourself with LOADMEMSPRITE or LOADSPRITE, CREATESCREEN, STRETCHSPRITE commands.

Crivens

Hmm. Then no, I don't believe my PC loses memory. It's what surprised me with the iPhone memory checks. I can check again tonight though.

I do it myself already with the routine I posted here. Basically loadsprite, along with stretchsprite and savesprite (so all the correct size to be loaded again in the future). But I wanted it to do it directly with the loadsprite or savesprite commands really. My main concern was the partially transparent stuff as I don't know how to preserve that information. Does GLB currently support that? So that you have different levels of transparency throughout the sprite. If not then my own routine will get me by.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Kitty Hello

with LOADMEMSPRITE you have the alpha information in the pixels.
When you "draw" the sprite to an offscreen surface, draw with alphamode -1 to preserver the alpha bits.

Crivens

Does it have the full alpha information for semi-transparency? If so then can you use it to load something in at a lower % size (or to save with full alpha information)? My main thought is if you have graphics that are retina sized, then you can load them into a non-retina iDevice at a set size (ratio worked out at X and Y from the intended resolution). This way you use less memory and it's got to be faster than using zoom/stretchsprite commands when you need them drawn. This would be far better than having specific retina/non-retina/ipad graphics and would easily work on other resolutions.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

ampos

Crivens, to incrementate a bit your paranoia, you can find any .ipa in my documents/my music/itunes/...idontremember, rename the ipa file to .zip and et voilá, here you have access to all ipa files without using any iphone file explorer...

:nana:

On my current app, I am making a shoebox per file, so I have a ton of files with the name "nnnnnn.sbx", and only one file inside the sbx, "page.png", as I have only 1 page (sprite) in memory at the same time. To load it, I use setshoebox pagenumber+".sbx","" / loadsprite 1,"page.png".

Will it have the same memory leak problem?
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Crivens

Heh, I'm not really bothered about people nicking the files (I nabbed most of it from Creative commons sites anyway), just looked a bit naff, and that I didn't want anyone to easily create their own levels. For the level thing any other apps I have planned it probably won't matter.

Yes I think it should have the same leak. When I tried the test the second time I used a new blank app that only had one media file in a shoebox. Repeating loading the same sprite from the shoebox into the same memory bank used up more and more memory (releasing only small amounts each time). I even tried loadsprite "",spritenumber to see if it would effect things and it didn't.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.