..whats wrong here..

BlitzMax Forums/BlitzMax Programming/..whats wrong here..

Naughty Alien(Posted 2009) [#1]
..okay, after I 'free' resources in my game, I noticed that actually amount of memory take is increased ?!..so i must be doing something wrong..in that light, why in this example allocated amount of memory space still remain same..

SuperStrict

Type MyType
     Field Image:TImage
End Type

GCCollect()
Print "Before Type is created "+GCMemAlloced()

Local a:MyType=New MyType
      a.Image = LoadImage("s1.dds")
	  
GCCollect()
Print "After Type is created "+GCMemAlloced()

a = Null
GCCollect()
Print "After Type is Released "+GCMemAlloced()


in my case I have for given texture I have used:
Before Type is created 14140
After Type is created 14152
After Type is Released 14152

how to properly clear up this?


Brucey(Posted 2009) [#2]
after I 'free' resources in my game, I noticed that actoaully amount of memory take is increased


Your example... runs for how long? 2 ms?

Try sticking all that in a loop and running it for 5 minutes, and then come back with your new results :-p


Brucey(Posted 2009) [#3]
And here are some links to other other posts on the subject.

Happy reading :-)


Naughty Alien(Posted 2009) [#4]
..ahh..my bad..its working actually :) I wasnt patient enough :)