More Memory Questions

BlitzMax Forums/BlitzMax Programming/More Memory Questions

The following code, compiled in non-debug mode, initially allocates 37K on memory. However, as the it runs it show that it has 50K to 60K of allocated memory.

1) Why?
2) Is there a way to change the code so the memory allocated is static?

SuperStrict


Global g_iInitialMemory:Int

Graphics 1024, 768,0, 0

'Reset & store the initial memory value.
GCCollect()
g_iInitialMemory = GCMemAlloced()

Repeat

	SetBlend SOLIDBLEND
	
	DrawText("Initial Allocated Memory = " + g_iInitialMemory, 10, 10)
	DrawText("        Allocated Memory = " + GCMemAlloced(), 10, 25)

	Flip -1
	Cls
Until KeyHit(KEY_ESCAPE)


Thanks