GLBasic forum

Main forum => GLBasic - en => Topic started by: MikeHart on 2009-Aug-27

Title: IPhone - Memory leak?
Post by: MikeHart on 2009-Aug-27
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
Title: Re: IPhone - Memory leak?
Post by: 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.
Title: Re: IPhone - Memory leak?
Post by: trucidare on 2009-Aug-27
Interessant.... das der kram ?berhaupt linkt unter 2.2.1...

Gernot schreib mal ab OS 3.0 ran.
Title: Re: IPhone - Memory leak?
Post by: MikeHart on 2009-Aug-27
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.
Title: Re: IPhone - Memory leak?
Post by: Kitty Hello on 2009-Aug-27
post it.
Title: Re: IPhone - Memory leak?
Post by: MikeHart on 2009-Aug-27
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.
Title: Re: IPhone - Memory leak?
Post by: Uncle on 2009-Aug-27
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.
Title: Re: IPhone - Memory leak?
Post by: trucidare on 2009-Aug-27
Yep, i think its from the startup code of the glbasic engine. 2 leaks in init code. but not sure.
Title: Re: IPhone - Memory leak?
Post by: Kitty Hello on 2009-Sep-01
Ah. I print the device ID before iPhoneMain. No memory pool is allocated that's why.
Just ignore it, it's 14 bytes.
Title: Re: IPhone - Memory leak?
Post by: MikeHart on 2009-Sep-01
I get also a memory leak when an app is closed.
Title: Re: IPhone - Memory leak?
Post by: Kitty Hello on 2009-Sep-02
post the output, please.
Title: Re: IPhone - Memory leak?
Post by: MikeHart on 2009-Sep-08
Hi gernot,

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

Michael
Title: Re: IPhone - Memory leak?
Post by: MikeHart on 2009-Sep-08
Ok, here are the output screenshots of the LEAK instrument.

[attachment deleted by admin]