playMaker

Author Topic: [SOLVED] SendEvent causes 1KB Garbage Collection per use?  (Read 2350 times)

Raptor5399

  • Playmaker Newbie
  • *
  • Posts: 17
[SOLVED] SendEvent causes 1KB Garbage Collection per use?
« on: November 09, 2014, 03:25:59 PM »
Having a look at the profiler it says a FixedUpdate method I am using for movement is causing 1KB to be garbage collected every time it is called.  I narrowed it down to one line at the very end of the method.

MovementFSM.SendEvent("TranslateXZ");

Where MovementFSM is a cached FSM and TranslateXZ is an Event on that FSM.

I tried duplicating that line a few times and each time the garbage collector registered another 0.9-1KB for every time the line appears.  I use SendEvent in a lot of other scripts that are not in the scene I am working on so this could be a rather big issue once they are all in use.  Any ideas as to how I could make SendEvent stop hitting the GC?

Unity 4.5.4f1
Playmaker 1.7.7.f6
« Last Edit: November 10, 2014, 03:55:11 PM by Raptor5399 »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: SendEvent causes 1KB Garbage Collection per use?
« Reply #1 on: November 09, 2014, 06:44:58 PM »
Are you profiling in the editor or attached to a build? There is extra logging and debug info generated in the editor...

Raptor5399

  • Playmaker Newbie
  • *
  • Posts: 17
Re: SendEvent causes 1KB Garbage Collection per use?
« Reply #2 on: November 10, 2014, 03:54:44 PM »
Ah, good.  I was doing it in Editor.  Tried using a build and it is gone :) thanks.