Too many GC Alloc !

Forums 💬 NodeCanvas 🗨️ General Discussion Too many GC Alloc !

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #14908
    unigames
    Participant

      Hi Gavalakis,
      I started using NC about 2 months ago ,it’s very useful for developing AI and game logic .

      Now I have a problem with GC alloc.
      I use many ‘get property’ actions and ‘execute function’ actions in my game.
      I found that a ‘get property’ action will cause 3KB GC alloc, and an ‘execute function’ action will cause 1.2KB GC alloc.

      To Test this problem ,I create a simple tree only include a ‘get property’ action and an ‘execute function’ action.
      the script on the agent :
      public class TestScript : MonoBehaviour
      {
      public int testProperty{get {return 0;} }
      public void Test() {}
      }

      When the game is playing, profiler window show that MonoManager.Update() have 4.2KB GC alloc per frame.

      If the game has 30-50 behaviour trees ,and each behaviour tree has 10-30 actions, the GC alloc can be more than 1MB per frame.It’s very terrible.

      How can I deal with this problem?

      By the way ,my NC version is 1.5.3

      #14913
      Gavalakis
      Keymaster

        Hello,

        I have some leads as of what might be causing this in the “Script Control” tasks after some latest refactors I did.
        Please allow me some time and I will fix it.

        Thanks for reporting!

        #14912
        kongbu0621
        Participant

          oh, no, I‘am afraid to use nodeCanvas, Too many GC Alloc, it’s very Fatal to a game

          #14911
          Gavalakis
          Keymaster

            @kongbu The high GC allocation happens only to the Script Control category tasks and it will be fixed soon.

            #14910
            huhund
            Participant

              I’m seeing some very high GC allocs as well in our project. Hope there can be a patch soon. Currently using 1.5.8.

              #14909
              Gavalakis
              Keymaster

                Hello,

                Please update to the latest version whenever you can. The current version is 1.5.9d.
                Let me know if you still get high GC allocations and if so, please provide me some more info / graph screenshot, or even if possible a sample project where you encounter this.

                Thanks

              Viewing 6 posts - 1 through 6 (of 6 total)
              • You must be logged in to reply to this topic.