Hello Guest

Author Topic: And yet another memory question!  (Read 4968 times)

Dajuice

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 45
    • View Profile
And yet another memory question!
« on: May 13, 2013, 02:54:19 pm »
Hi there, just asking: have you been playing around with the new memory profiler? This tool makes the memory profiling usable at last! But the infos it shows me makes me wonder why are there source images in the memory of my .exe? isn't there supposed to be links to the atlases only?

Also, theres a texture I'm trying to unload but I'm not able: only one sprite uses the collection, the sprite is not referenced anywhere, there is no special script on it (it is a still image, the splash screen) it is loaded in the stub scene, which is replaced by a dummy scene (to unload the stub) when my UI takes the place, I changed the sprite collection before deletion. My tests suggest that only the starting collection and the one that is applied on the sprite upon deletion are kept in memory, any intermediate collections are effectively cleaned from memory, do you have an idea of what is happening?

Oh also, this is no support material, but as always, I'm giving you some feedback so you may (or may not) improve your user experience: I find myself using alot of textures with no alpha ( improves greatly GPU performances on some mobile devices and optimises memory), the only compression without alpha that tk2d offers is dithered and I'm no fan of dithering ;) I noticed the User defined checkbox right under, could be cool if this checkbox was right over instead?

Thanks for your time!
« Last Edit: May 13, 2013, 03:11:05 pm by Dajuice »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: And yet another memory question!
« Reply #1 on: May 13, 2013, 10:06:29 pm »
Do you keep a reference to the tk2dSpriteCollection object anywhere in your project? That is the only case the source images get included in the exe. There are no references to any of the source images kept in the tk2dSpriteCollectionData object, which is what the runtime uses. Can you check that you're not acccidentally keeping a reference somewhere?

I think there may be more than one issue at play here.

Dajuice

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: And yet another memory question!
« Reply #2 on: May 14, 2013, 02:40:52 pm »
I may very well have references to the sprite collection somewhere... Aaaaand it's done! No more references to those sprite collections and gained a little 20MB! What a relief! It was some temporary dev script that I forgot to delete that kept those references so no sweat on deleting it ;)

So now one of the issues is fixed, is there any info you could provide me on how, when I load a scene to replace my stub scene, no texture that was in this scene is unloaded? (I tried with my gameplay cache sprite bunch that is unloaded for sure with every gameplay and it still remains in memory when in the stub)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: And yet another memory question!
« Reply #3 on: May 14, 2013, 02:54:09 pm »
How do you unload the scene? Just Application.LoadLevel?

Dajuice

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: And yet another memory question!
« Reply #4 on: May 14, 2013, 03:25:14 pm »
yes, I load a dummy level with nothing in it, it works for the gameplay, everything is unloaded, but not for my stub... it happens a little after I load my UI with LoadLevelAdditive.