playMaker

Author Topic: gc.collect giving huge CPU spikes for PlaymakerFSM.OnTriggerStay() [SOLVED]  (Read 3215 times)

pneill

  • Playmaker Newbie
  • *
  • Posts: 32
I have a scene with about 20 spawned objects using Pool Manager.  Each spawned object has a rigidbody.  The scene works great, except about every 30 seconds or so the GC.collect function associated to the PlaymakerFSM.OnTriggerStay() event hammers my scene and drives the frame rate to under 30 seconds.  Any clue what's happening here?  I'm using 1.3.2
« Last Edit: April 05, 2012, 09:53:44 PM by Alex Chouls »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: gc.collect giving huge CPU spikes for PlaymakerFSM.OnTriggerStay()
« Reply #1 on: April 04, 2012, 06:07:06 AM »
Hi,

 I am not sure why it is so, but I never use OnTriggerStay, instead I rely on triggerEnter and triggerExit
I only use trigger stay when loading scenes or objects that "could" be already triggering ( because triggerEnter would not trigger properly), for your gameLoop, I would avoid this all together.

but of course if would be good to get to the bottom of this peaks.

 Bye,

 Jean

pneill

  • Playmaker Newbie
  • *
  • Posts: 32
Re: gc.collect giving huge CPU spikes for PlaymakerFSM.OnTriggerStay()
« Reply #2 on: April 04, 2012, 11:34:54 AM »
Hi Jean, thanks for responding.

That's the curious part.  I don't use onTriggerStay anywhere in the FSM.  I do use onTriggerEnter, but never OnTriggerStay.  And remember this issue is a just a GC event associated with onTriggerStay.  I thought that perhaps PlayMaker was calling OnTriggerStay in the background?
« Last Edit: April 04, 2012, 12:00:10 PM by pneill »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: gc.collect giving huge CPU spikes for PlaymakerFSM.OnTriggerStay()
« Reply #3 on: April 04, 2012, 04:48:20 PM »
Are you seeing this in the editor or standalone builds? There is some logging going on in the editor that could cause gc calls. If you turn off logging (in the debug menu) does it help?

pneill

  • Playmaker Newbie
  • *
  • Posts: 32
Re: gc.collect giving huge CPU spikes for PlaymakerFSM.OnTriggerStay()
« Reply #4 on: April 04, 2012, 10:50:19 PM »
It was in editor mode and turning off the debug logging in playmaker did the trick.