IPhone - Memory leak?

Previous topic - Next topic

MikeHart

Hi folks,

I tested this little script here on my Ipod touch, compiled with the 2.2.1 SDK:

Code (glbasic) Select


SETCURRENTDIR("Media") // seperate media and binaries?

maxstars% = 100
sprTitle% = 1
sprTeam% = 2
sprGFX% = 3

DIM stars[maxstars][2]



setup_stars()
LIMITFPS 20
draw_screen()
END

FUNCTION draw_screen:
WHILE TRUE
FOR i% = 1 TO maxstars
SETPIXEL stars[i%-1][0],stars[i%-1][1],RGB(0,0,RND(100)+155)
NEXT
SHOWSCREEN
WEND
ENDFUNCTION

FUNCTION setup_stars:
FOR i% = 1 TO maxstars
stars[i%-1][0] = RND(480)
stars[i%-1][1] = RND(320)
NEXT
ENDFUNCTION



When I started with the LEAK Instrument, it reports a leak after around 10-14 seconds, and when I close the app via the home button.

Any ideas? Do have to worry about these leaks?

Cheers
Michael

Kitty Hello

Any more details about the leak?
Usually all GLBasic commands should not leak, thus it must be something internal.

trucidare

Interessant.... das der kram ?berhaupt linkt unter 2.2.1...

Gernot schreib mal ab OS 3.0 ran.
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

MikeHart

Quote from: Kitty Hello on 2009-Aug-27
Any more details about the leak?
Usually all GLBasic commands should not leak, thus it must be something internal.

What do you need, the LEAK tool gives tons of Info.

Kitty Hello


MikeHart

To lazy to do it now. I thought you would able to replicate it when you create a project yourself with the code I posted above.

But that is no problem Gernot. Trucidare allready said that GLB is only for SDK 3.0. So just forget about it. Everything is just fine. Thank you for spending time on this.

Uncle

Just for info.  I ran it using OS 3.0 (as its all I have on my machine) and I only had one very minor leak of about 114 bytes.  This spike happened at the start of the process and then the remaining 7 minutes that I ran the test everything was fine.

trucidare

Yep, i think its from the startup code of the glbasic engine. 2 leaks in init code. but not sure.
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

Kitty Hello

Ah. I print the device ID before iPhoneMain. No memory pool is allocated that's why.
Just ignore it, it's 14 bytes.

MikeHart

I get also a memory leak when an app is closed.

Kitty Hello

post the output, please.

MikeHart

Hi gernot,

I will post something from LEAK as soon as possible. I am very busy with non glb related stuff.

Michael

MikeHart

Ok, here are the output screenshots of the LEAK instrument.

[attachment deleted by admin]