playMaker

Author Topic: Memory keeps growing[SOLVED]  (Read 1118 times)

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
    • View Profile
Memory keeps growing[SOLVED]
« on: February 24, 2017, 06:20:02 AM »
Hi,

While using the app, I've noticed that the memory just keeps growing and growing, and it doesn't decrease, so eventually after playing 20-30 minutes it will crash. I know about profiler, but it doesn't seem to show the exact points/variables where the memory is assigned etc.. Or It might but I don't know where to look. And it's definitely an FSM that is doing this since it's only when I click certain things but without knowing what exactly causes this it's hard for me to find out as there is +100 fsms and a lot of variables.
« Last Edit: March 03, 2017, 04:36:20 AM by jeanfabre »

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
    • View Profile
Re: Memory keeps growing
« Reply #1 on: February 24, 2017, 07:48:47 AM »
Ok I think I worked out that it's Easy Save 2.

ES2LoadObjectAction'1.OnEnter()  - Allocates 1.1MB

and the same one, but allocates 4.8MB 

This happens a few times, and all in total it allocates about 10-15MB, and it seems like it's not disposing but it does execute some dispose() method because I can see in the profiler... Any ideas?

Also a question regarding performance of datamaker... I load an xml to the proxy when the app starts, and I'm querying it very extensively. Is there a performance decrease of having the data in the proxy all the time, do I like need to load it only when I want to query the data and then dispose the proxy off data or that is not needed and It can just be loaded and it can stay in proxy until app quits?
« Last Edit: February 24, 2017, 07:57:54 AM by elusiven »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4317
    • View Profile
    • jinxtergames
Re: Memory keeps growing
« Reply #2 on: February 24, 2017, 08:31:54 AM »
Hi,
For ES2 i don't Know what the issue is, maybe you can better aks on the ES2 forum.

For Datamaker it would be better for performance to load it once,
it will use a small part of your memory but it will not affect you performance.

if you would reload it every time, it could affect performance but even that i think is minimal.

But in theory loading once is best for performance.
FOR HIRE:Playmaker/C#

Playmaker Samples <-------------> Easy Exporter <---------------------> TPA Actions

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
    • View Profile
Re: Memory keeps growing
« Reply #3 on: February 27, 2017, 09:13:01 AM »
Okay I noticed that there are 4 new textures each time I enter this mini-game. So it's piling up unused textures and not destroying them. What works is to call Remove Unused assets but that's not very efficient and it only removes new ones, the first ones still stay in the memory, as if they are being used but they are not, is there an alternative to mark those textures for GC? - I don't see them in the inspector or as a variable, I only see sprites and I already tried deleting Sprites textures and this does not help because the images go black.

Any ideas please?
« Last Edit: February 27, 2017, 03:53:34 PM by elusiven »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14237
  • Official Playmaker Support
    • View Profile
Re: Memory keeps growing
« Reply #4 on: February 28, 2017, 10:52:19 PM »
Hi,

 Textures are not created out of the blue, so you need to find out where and why your mini game needs to create textures, and then debug that to see why it keeps creating texture.

Also, an Fsm in itself doesn't do anything apart from running actinos, so you have to look at the actions you use, that's where things are likely starting.

 Are you using other assets that could be linked to creating textures?

Bye,

 Jean

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
    • View Profile
Re: Memory keeps growing
« Reply #5 on: March 01, 2017, 06:10:00 AM »
I fixed it now... I was removing the textures that were still in use - that's why the images were going black. I moved my modified destroy action to end of level and it works, after the level is finished the textures get destroyed and then when it starts again they get created again.

Thanks

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14237
  • Official Playmaker Support
    • View Profile
Re: Memory keeps growing
« Reply #6 on: March 03, 2017, 04:36:05 AM »
Hi,

 Good, I am glad you found the issue.

 Bye,

 Jean