playMaker

Author Topic: Playmaker Garbage Collect Freeze  (Read 114 times)

Sly

  • Full Member
  • ***
  • Posts: 116
    • View Profile
Playmaker Garbage Collect Freeze
« on: December 03, 2019, 01:40:57 PM »
Hello,

I actually having some issue (short freeze) with Garbage Collect when I play my game. I saw on the profiler it came from Playmaker GC.Collect.
Like mentioned on other topic, I profile my game on a build, and not in the unity editor, but it still happen.

I'm actually using a custom actions that I've made, but I don't understand how I can trace where it came from. Is there a way to?
Is it better to use a FinishFSM action at the end of none active FSM?

Note: Regarding other thread about it, I never use Run Fsm Template (who can apparently create some issue). But I use Run Fsm in various way.

Thanks in advanced!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4613
    • View Profile
    • jinxtergames
Re: Playmaker Garbage Collect Freeze
« Reply #1 on: December 03, 2019, 08:38:49 PM »
Hi.
i use several run fsms but did not have issues with it yet.

usually if garbage collect freeze the game it mean that there is a lot of garbage

Do you use many create/destroy actions (for example bullets/enemies) ?

if so you might want to look into pooling.

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 740
    • View Profile
Re: Playmaker Garbage Collect Freeze
« Reply #2 on: December 03, 2019, 11:12:07 PM »
Also, the profiler works well with Playmaker. Click the deep profile button when you game is playing. Look for any visual spikes in the profile and set the timeline to that location.

Try changing your profiler to Heirchery. Then expand sections with the most garbage. Keep expanding them until you find the source of the most amount of garbage collection. It should give you the method or methods that are causing the most problem.


Sly

  • Full Member
  • ***
  • Posts: 116
    • View Profile
Re: Playmaker Garbage Collect Freeze
« Reply #3 on: December 04, 2019, 06:03:20 AM »
Hello,

Because my game is generating randomly the level, I create a lot's of object at beginning (during loading). But not really after.
I've made a pooling system for my sounds and visual effect (to avoid create/destroy), and most of my NPC are spawned during loading.

I just don't understand where to find what is fulling the GC. Even in the deep profile, I just see PlayMakerFSM.Update() -> GC.Collect.
How can I know what's going on?

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 740
    • View Profile
Re: Playmaker Garbage Collect Freeze
« Reply #4 on: December 04, 2019, 06:50:11 AM »
You cannot open a deeper level than the update method? Can you share a screenshot?

Sly

  • Full Member
  • ***
  • Posts: 116
    • View Profile
Re: Playmaker Garbage Collect Freeze
« Reply #5 on: December 04, 2019, 07:11:23 AM »
That's the problem, even with the deep profile, I'm not seeing anything else than PlayMakerFSM.Update() and GC.Collect :/

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 740
    • View Profile
Re: Playmaker Garbage Collect Freeze
« Reply #6 on: December 04, 2019, 07:39:23 AM »
With all that open, click on the GC column, to sort the highest items of GC to the top.

For example, we can see that the weapon property update is 13.3.

Sly

  • Full Member
  • ***
  • Posts: 116
    • View Profile
Re: Playmaker Garbage Collect Freeze
« Reply #7 on: December 04, 2019, 08:01:31 AM »
With this I agree that weapon property has 13,3, and it's a lot. But still PlaymakerFSM.Update is at 104. That's the thing I don't understand. What cause this and how to find out.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14684
  • Official Playmaker Support
    • View Profile
Re: Playmaker Garbage Collect Freeze
« Reply #8 on: December 04, 2019, 11:08:24 PM »
Hi,

 in these cases, it's often not Playmaker but the content you are working with inside PlayMaker that is the issue.

So can you check your prefab that you use int he pool on its own, and see what kind of garbage memory is uses? try to remove features and test if you are in a blur as to what's going on. do that until you don't have GC and deduce that it's the last part you disabled that causes it.

Bye,

 Jean

Sly

  • Full Member
  • ***
  • Posts: 116
    • View Profile
Re: Playmaker Garbage Collect Freeze
« Reply #9 on: December 05, 2019, 12:04:40 PM »
Hello,

Thanks for your answer.
I'm actually trying to deactivate and optimize my fsm.

I note that some custom action download from Ecosystem are not always optimize (100% of case it is not from Dev of Playmaker). Like having GetComponent X3 in an update function :/

Anyway, I try to optimize ny stuff and let you know the result!

Thanks!