playMaker

Author Topic: [IOS] - MonoHeap constantly growing on scene change =_=...not good.. [FIXED]  (Read 3832 times)

giyomu

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 108
    • blog
Hi all , just get across this issue which is really critical, so unless I missed something...

I provide a test scene where i simply switch from blank scene to a scene that instantiate 100 cube >

- one with no Fsm and having a script making them rotate
- one that have a simple state with no action ( so for you to try add on on of the CubeFsm a simple Fsm with nothing else than start state, no action )

ok so then i switching rapidly between both scene here is what i get from profiler console in Xcode for Cube without Fsm >>

each line is about a scene switch :

mono-memory>   used heap: 159744 allocated heap: 196608 start with blank scene app start run
mono-memory>   used heap: 217088 allocated heap: 266240
mono-memory>   used heap: 217088 allocated heap: 266240 blank
mono-memory>   used heap: 217088 allocated heap: 266240
mono-memory>   used heap: 212992 allocated heap: 266240 blank
mono-memory>   used heap: 217088 allocated heap: 266240
mono-memory>   used heap: 217088 allocated heap: 266240 blank
mono-memory>   used heap: 217088 allocated heap: 266240
mono-memory>   used heap: 217088 allocated heap: 266240 blank
mono-memory>   used heap: 217088 allocated heap: 266240
mono-memory>   used heap: 217088 allocated heap: 266240 blank
mono-memory>   used heap: 217088 allocated heap: 266240
mono-memory>   used heap: 217088 allocated heap: 266240 blank
mono-memory>   used heap: 217088 allocated heap: 266240
mono-memory>   used heap: 217088 allocated heap: 266240 blank

15 times switch , as you see and expected behavior as long the scene you went allocated a certain amount go back and forth do not do some additive allocation, so the allocated heap remain constant ( until you load a scene with lot more contents, which in that case will raise but that's perfectly expected.. )

>>> Now the cube with 1 fsm on it ..

mono-memory>   used heap: 159744 allocated heap: 196608 blank
mono-memory>   used heap: 372736 allocated heap: 479232
mono-memory>   used heap: 376832 allocated heap: 479232 blank
mono-memory>   used heap: 552960 allocated heap: 643072
mono-memory>   used heap: 552960 allocated heap: 643072 blank
mono-memory>   used heap: 716800 allocated heap: 860160
mono-memory>   used heap: 716800 allocated heap: 860160 blank
mono-memory>   used heap: 888832 allocated heap: 1150976
mono-memory>   used heap: 888832 allocated heap: 1150976 blank
mono-memory>   used heap: 1056768 allocated heap: 1150976
mono-memory>   used heap: 1056768 allocated heap: 1150976 blank
mono-memory>   used heap: 1232896 allocated heap: 1536000
mono-memory>   used heap: 1228800 allocated heap: 1536000 blank
mono-memory>   used heap: 1396736 allocated heap: 1536000
mono-memory>   used heap: 1396736 allocated heap: 1536000 blank
mono-memory>   used heap: 1560576 allocated heap: 2052096
mono-memory>   used heap: 1560576 allocated heap: 2052096 blank

so about 17 times change as you see the heap for a similar scene just keep on and on ...

it will have the same effect if I was filling static list each time i go in this scene and not clear them when i leave ...not sure where is the issue but for what i see it happens when i start to have Fsm in scene.

that's big issue for me because if this is something on playmaker end , it make it unreliable for my iOS dev as looking at this when working on more rich level with Fsm to drive AI lot of things well after you pass few level the game crash simply due of the mono heap getting over.

I am curious somebody didn't catch that yet , anyway i drop the package i used for my example, so if you come up with something that do not behave that way please share  ;D...or I am good to rip all Fsm form my current game  :'(...

just remember to add simple fsm component on  the CubeFsm prefab and go check you Xcode profiler    

  
« Last Edit: October 06, 2011, 03:56:10 PM by alexchouls »

giyomu

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 108
    • blog
Re: [IOS] - MonoHeap constantly growing on scene change =_=...not good..
« Reply #1 on: July 09, 2011, 08:57:42 PM »
ah just forgot , that i tested both on PM1.1 and last beta , same behaviors

tobbeo

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 186
Re: [IOS] - MonoHeap constantly growing on scene change =_=...not good..
« Reply #2 on: July 09, 2011, 11:11:06 PM »
Good catch, I hope Alex can fix this!

giyomu

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 108
    • blog
Re: [IOS] - MonoHeap constantly growing on scene change =_=...not good..
« Reply #3 on: July 10, 2011, 08:45:55 PM »
as a quick note it seem behave same in any other platform, memory add up each time

Alex is on it , i Hope he will identify the issue soon :D

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: [IOS] - MonoHeap constantly growing on scene change =_=...not good..
« Reply #4 on: July 26, 2011, 01:13:35 AM »
Thanks giyomu for catching this! Just to let everyone else know, this is fixed in the 1.2 update.