Playmaker Forum

Bug Reporting => PlayMaker Bug Reporting => Topic started by: Raptor5399 on November 09, 2014, 03:25:59 PM

Title: [SOLVED] SendEvent causes 1KB Garbage Collection per use?
Post by: Raptor5399 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
Title: Re: SendEvent causes 1KB Garbage Collection per use?
Post by: Alex Chouls 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...
Title: Re: SendEvent causes 1KB Garbage Collection per use?
Post by: Raptor5399 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.