Possible memory leak?

Monkey Forums/Monkey Programming/Possible memory leak?

GfK(Posted 2011) [#1]
Just testing my game this morning and noticed that resource usage (in TaskManager) went through the roof. I've narrowed it down to use of SetColor. The code below uses a largeish image(512x512) to emphasise the effect though it happens with smaller graphics as well.
Import mojo

Function Main()
	New myApp
End

Class myApp Extends App
	Field img:Image
	Method OnCreate()
		Self.img = LoadImage("1.jpg")
		SetUpdateRate(30)
	End
	
	Method OnRender()
		Cls
		SetColor Rnd(0,255),Rnd(0,255),Rnd(0,255)
		DrawImage(Self.img,0,0)
	End Method
End

I'm testing in HTML5 though the app will be released for iOS. If you run the program and watch TaskManager you'll see that memory usage quickly grows to over 300MB. I've read somewhere that using SetColor is a bit dodgy in HTML5, and that's fine. But does this problem also affect apps running in iOS, or Android for that matter? I don't know much about it but I'd imagine hogging over 300MB because I'm using SetColor, is going to be a massive problem on mobile devices.


Raz(Posted 2011) [#2]
I'd hazard a guess that this is a HTML5 issue. Because HTML5 doesn't directly support colours for drawing images. Whereas at the same time, I am pretty sure every other language does.

I know for a fact that SetColor does not cause a memory leak in XNA, but haven't monitored other languages.