News Forums RAIN General Discussion and Troubleshooting When Loading BTAsset, GC Alloc a lot

This topic contains 12 replies, has 3 voices, and was last updated by  tgraupmann 1 month, 1 week ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #7555

    Yuewah Chan
    Participant

    mind.behaviorTreeAsset = Resources.Load(string.Format(“BehaviorTrees/{0}”,”Guest”), typeof(BTAsset)) as BTAsset;
    aiRig.AI.AIInit();

    The BT contains some Custom Action which need to load using Assembly.CreateInstance. In Unity Deep Profiler, it allocate a lot of memory, is it possible to minimize it ?

    https://dl.dropboxusercontent.com/u/9322397/RAIN/Rain_AIInit.png

    #7628

    prime
    Keymaster

    I don’t believe those numbers are accurate. For example, they are reporting String.Split taking 172KB. I don’t think that performing a split operation on a 30 character string requires almost 200k of memory. The similarly, calling type.Name doesn’t require 283K. I doubt it uses 283 bytes. In addition, the assembly sizes are skewed because you are running in the editor.

    In general, the profiler serves as a guide for finding problems, but can be wildly inaccurate at times.

    #7630

    Yuewah Chan
    Participant

    sorry, profile in editor is inaccurate, let me try to profile in device instead.

    #7918

    Yuewah Chan
    Participant

    In Rain 1.x , when I load BT ( ~ 50 nodes, half of them is custom class in global assembly ) in runtime, it didn’t drop too much frame-rate, but after upgraded to Rain 2.x, it drop significantly, could you have any performance test case for this situation ?

    #8983

    Yuewah Chan
    Participant

    I found that BTLoader is very slow when the BT contains many custom class in global assembly as it use reflection to create the class object. Any thing that I can do to make it load faster ?

    #9018

    prime
    Keymaster

    I’ll put a note in our task list to look into optimizing that. We can probably cache assemblies and check most recently used assemblies first.

    #9063

    Yuewah Chan
    Participant

    Is your method used in RAIN 1.x for custom action ? I have no problem on it.

    #9081

    Yuewah Chan
    Participant

    What is the time frame to optimize for caching the assemblies? If it is too long, we need to rollback to rain 1.x

    #9276

    prime
    Keymaster

    Send an email to jester please. We can discuss possibly getting you a pre-release custom version in advance of our planned release schedule.

    #9333

    Yuewah Chan
    Participant

    email is sent.

    #9996

    Yuewah Chan
    Participant

    I know you guys is busy, but how is the pre-release custom version ?

    #10357

    prime
    Keymaster

    Working on it. Give me a ping on Monday.

    #39709

    tgraupmann
    Participant

    [moved]

    • This reply was modified 1 month, 1 week ago by  tgraupmann.
    • This reply was modified 1 month, 1 week ago by  tgraupmann.
    • This reply was modified 1 month, 1 week ago by  tgraupmann. Reason: simplify code example
    • This reply was modified 1 month, 1 week ago by  tgraupmann.
    • This reply was modified 1 month, 1 week ago by  tgraupmann.
Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.