Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Remote Config Native Collection memory leak

Discussion in 'Unity Remote Config' started by ramsayamarin, Jul 16, 2021.

  1. ramsayamarin

    ramsayamarin

    Joined:
    Feb 10, 2013
    Posts:
    16
    Windows 10, Unity 2021.1.15f1, Remote Config 2.0.1, Android Build Target

    I call Remote Config Fetch on Awake once on startup and it throws the error "A Native Collection has not been disposed, resulting in a memory leak. Allocated from: Unity.Collections.NativeArray`1:.ctor(Byte[], Allocator)"

    It appears to occur here in ConfigManagerImpl:
    Code (CSharp):
    1. request.uploadHandler = new UploadHandlerRaw(Encoding.UTF8.GetBytes(jsonText));
    Here is the full stack trace obtained using the Jobs package with Full Stack Traces:
    Code (CSharp):
    1.  [Error] A Native Collection has not been disposed, resulting in a memory leak. Allocated from:
    2. Unity.Collections.NativeArray`1:.ctor(Byte[], Allocator)
    3. ConfigManagerImpl.DoRequest() at Library\PackageCache\com.unity.remote-config-runtime@1.0.1\Runtime\ConfigManagerImpl.cs:267
    4. 265:       request.SetRequestHeader(header.key, header.value);
    5. 266:   }
    6. -->267:   request.uploadHandler = new UploadHandlerRaw(Encoding.UTF8.GetBytes(jsonText));
    7. 268:   request.downloadHandler = new DownloadHandlerBuffer();
    8. 269:   request.SendWebRequest().completed += (AsyncOperation op) => {
    9. ConfigManagerImpl.PostConfig() at Library\PackageCache\com.unity.remote-config-runtime@1.0.1\Runtime\ConfigManagerImpl.cs:204
    10. 202:   {
    11. 203:       var jsonText = PreparePayload(userAttributes, appAttributes);
    12. -->204:       DoRequest(jsonText);
    13. 205:   }
    14. ConfigManagerImpl.FetchConfigs() at Library\PackageCache\com.unity.remote-config-runtime@1.0.1\Runtime\ConfigManagerImpl.cs:188
    15. 186:   public void FetchConfigs<T, T2>(T userAttributes, T2 appAttributes) where T : struct where T2 : struct
    16. 187:   {
    17. -->188:       PostConfig(userAttributes, appAttributes);
    18. 189:   }
    19. ConfigManager.FetchConfigs() at Library\PackageCache\com.unity.remote-config-runtime@1.0.1\Runtime\ConfigManager.cs:96
    20. 94:   public static void FetchConfigs<T, T2>(T userAttributes, T2 appAttributes) where T : struct where T2 : struct
    21. 95:   {
    22. -->96:       _configmanagerImpl.FetchConfigs(userAttributes, appAttributes);
    23. 97:   }
    24. ConfigFetcher.Fetch() at Assets\Scripts\Common\Utilities\ConfigFetcher.cs:55
    25. 54:       IsFetching = true;
    26. -->55:       ConfigManager.FetchConfigs<UserAttributes, AppAttributes>(new UserAttributes(), new AppAttributes());
    27. 56:   }
    28. ConfigFetcher.Awake() at Assets\Scripts\Common\Utilities\ConfigFetcher.cs:34
    29. 32:       ConfigManager.SetEnvironmentID(_environmentId);
    30. 33:       ConfigManager.FetchCompleted += ApplyRemoteSettings;
    31. -->34:       Fetch();
    32. 35:   }
    33. 36:   else if (this != Instance)
    34. Object.Internal_CloneSingleWithParent()
    35. Object.Instantiate()
    36. Object.Instantiate()
    37. Object.Instantiate()
    38. PersistentObjectsInstantiator.Awake() at Assets\Scripts\Common\PersistantObjects\PersistentObjectsInstantiator.cs:27
    39. 25:       }
    40. 26:       DontDestroyOnLoad(gameObject);
    41. -->27:       _presistentObjects = Instantiate(PersistentObjects, transform);
    42. 28:   }
    43. 29:   else if (this != _instance)
    Any idea how to fix this? My suspicion is that UploadHandlerRaw is not wrapped inside a using statement.
     
    Last edited: Jul 16, 2021
    cryogee likes this.
  2. cryogee

    cryogee

    Joined:
    Aug 6, 2009
    Posts:
    132
    I'm facing memory leak issue too. On Mac : Unity 2021.1.14f1
     
  3. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
  4. cryogee

    cryogee

    Joined:
    Aug 6, 2009
    Posts:
    132
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using Unity.RemoteConfig;
    5. //using com.ootii.Messages;
    6.  
    7. public class RemoteConfigManager : MonoBehaviour
    8. {
    9.     public struct userAttributes { }
    10.     public struct appAttributes { }
    11.  
    12.     private void Awake()
    13.     {
    14.         ConfigManager.FetchCompleted += ApplyRemoteSettings;
    15.  
    16.         // Set the user’s unique ID:
    17.         //ConfigManager.SetCustomUserID("some-user-id");
    18.  
    19.         // Set the environment ID:
    20.         //ConfigManager.SetEnvironmentID("an-env-id");
    21.  
    22.         ConfigManager.FetchConfigs<userAttributes, appAttributes>
    23.                  (new userAttributes(), new appAttributes());
    24.     }
    25.  
    26.     void ApplyRemoteSettings(ConfigResponse configResponse)
    27.     {
    28.         // Conditionally update settings, depending on the response's origin:
    29.         switch (configResponse.requestOrigin)
    30.         {
    31.             case ConfigOrigin.Default:
    32.                 Debug.Log("No settings loaded this session; using default values.");
    33.                 break;
    34.             case ConfigOrigin.Cached:
    35.                 Debug.Log("No settings loaded this session; using cached values from a previous session.");
    36.                 break;
    37.             case ConfigOrigin.Remote:
    38.                 //MessageDispatcher.SendMessage(GAMEEVENTS.EVT_REMOTE_SETTINGS_FETCH_COMPLETE, 1);
    39.                 Debug.Log("New settings loaded this session; update values accordingly.");
    40.                 //Debug.Log("Ball Speed : "+ ConfigManager.appConfig.GetFloat("ballspeed"));
    41.                 //enemyVolume = ConfigManager.appConfig.GetInt("enemyVolume");
    42.                 //enemyHealth = ConfigManager.appConfig.GetInt("enemyHealth");
    43.                 //enemyDamage = ConfigManager.appConfig.GetFloat("enemyDamage");
    44.                 //assignmentId = ConfigManager.appConfig.assignmentID;
    45.                 break;
    46.         }
    47.     }
    48.  
    49.     private void OnDestroy()
    50.     {
    51.         ConfigManager.FetchCompleted -= ApplyRemoteSettings;
    52.     }
    53.  
    54.  
    55.  
    56.     //TESTING
    57.  
    58.     private void Start()
    59.     {
    60.         //InvokeRepeating("Test", 10.0f, 10.5f);
    61.     }
    62.  
    63.     void Test()
    64.     {
    65.         Debug.Log("Fetching again.");
    66.         ConfigManager.FetchConfigs<userAttributes, appAttributes>
    67.                  (new userAttributes(), new appAttributes());
    68.     }
    69.  
    70.     //TODO If Awake doesnt fetch a value then we might have to check again after some time to fetch fresh set of values
    71. }
    72.  
    This is my code. I created a new scene with just a camera and a game object called RemoteConfigSettings manager and added this script to it. If you play 2-3 times you should see the error. Im using Mac.
     
  5. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Got it, where does the exception occur?
     
  6. cryogee

    cryogee

    Joined:
    Aug 6, 2009
    Posts:
    132
    I enabled full stack trace by adding entities package and using the Menu: Jobs -> Leak Detection -> Full Stack Traces (Expensive).

    and this extra details were there in log

    Code (CSharp):
    1. A Native Collection has not been disposed, resulting in a memory leak. Allocated from:
    2. Unity.Collections.NativeArray`1:.ctor(Byte[], Allocator) (at /Users/bokken/buildslave/unity/build/Runtime/Export/NativeArray/NativeArray.cs:69)
    3. UnityEngine.Networking.UploadHandlerRaw:.ctor(Byte[]) (at /Users/bokken/buildslave/unity/build/Modules/UnityWebRequest/Public/UploadHandler/UploadHandler.bindings.cs:98)
    4. Unity.RemoteConfig.ConfigManagerImpl:DoRequest(String) (at Library/PackageCache/com.unity.remote-config-runtime@1.0.1/Runtime/ConfigManagerImpl.cs:267)
    5. Unity.RemoteConfig.ConfigManagerImpl:PostConfig(Object, Object) (at Library/PackageCache/com.unity.remote-config-runtime@1.0.1/Runtime/ConfigManagerImpl.cs:204)
    6. Unity.RemoteConfig.ConfigManagerImpl:FetchConfigs(userAttributes, appAttributes) (at Library/PackageCache/com.unity.remote-config-runtime@1.0.1/Runtime/ConfigManagerImpl.cs:188)
    7. Unity.RemoteConfig.ConfigManager:FetchConfigs(userAttributes, appAttributes) (at Library/PackageCache/com.unity.remote-config-runtime@1.0.1/Runtime/ConfigManager.cs:96)
    8. RemoteConfigManager:Awake() (at Assets/JL_Game/Scripts/RemoteConfigManager.cs:22)
    9.  
    Does this help
     
  7. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you confirm it is in FetchConfigs? Simply add Debug.Log statements before and after to confirm, they will show in the logcat logs.
     
  8. cryogee

    cryogee

    Joined:
    Aug 6, 2009
    Posts:
    132
    I added debug statements but error occurs at end while exiting the play mode

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using Unity.RemoteConfig;
    5. using com.ootii.Messages;
    6.  
    7. public class RemoteConfigManager : MonoBehaviour
    8. {
    9.     public struct userAttributes { }
    10.     public struct appAttributes { }
    11.  
    12.     private void Awake()
    13.     {
    14.         Debug.Log("A");
    15.         ConfigManager.FetchCompleted += ApplyRemoteSettings;
    16.         Debug.Log("B");
    17.         // Set the user’s unique ID:
    18.         //ConfigManager.SetCustomUserID("some-user-id");
    19.  
    20.         // Set the environment ID:
    21.         //ConfigManager.SetEnvironmentID("an-env-id");
    22.         Debug.Log("C");
    23.         ConfigManager.FetchConfigs<userAttributes, appAttributes>
    24.                  (new userAttributes(), new appAttributes());
    25.         Debug.Log("D");
    26.     }
    27.  
    28.     void ApplyRemoteSettings(ConfigResponse configResponse)
    29.     {
    30.         // Conditionally update settings, depending on the response's origin:
    31.         switch (configResponse.requestOrigin)
    32.         {
    33.             case ConfigOrigin.Default:
    34.                 Debug.Log("No settings loaded this session; using default values.");
    35.                 break;
    36.             case ConfigOrigin.Cached:
    37.                 Debug.Log("No settings loaded this session; using cached values from a previous session.");
    38.                 break;
    39.             case ConfigOrigin.Remote:
    40.                 Debug.Log("GAA");
    41.                 MessageDispatcher.SendMessage(GAMEEVENTS.EVT_REMOTE_SETTINGS_FETCH_COMPLETE, 1);
    42.                 Debug.Log("GBB");
    43.                 Debug.Log("New settings loaded this session; update values accordingly.");
    44.                 //Debug.Log("Ball Speed : "+ ConfigManager.appConfig.GetFloat("ballspeed"));
    45.                 //enemyVolume = ConfigManager.appConfig.GetInt("enemyVolume");
    46.                 //enemyHealth = ConfigManager.appConfig.GetInt("enemyHealth");
    47.                 //enemyDamage = ConfigManager.appConfig.GetFloat("enemyDamage");
    48.                 //assignmentId = ConfigManager.appConfig.assignmentID;
    49.                 break;
    50.         }
    51.     }
    52.  
    53.     private void OnDestroy()
    54.     {
    55.         Debug.Log("G");
    56.         ConfigManager.FetchCompleted -= ApplyRemoteSettings;
    57.         Debug.Log("H");
    58.     }
    59.  
    60.  
    61.  
    62.     //TESTING
    63.  
    64.     private void Start()
    65.     {
    66.         //InvokeRepeating("Test", 2.0f, 2.5f);
    67.     }
    68.  
    69.     void Test()
    70.     {
    71.         Debug.Log("Fetching again.");
    72.         Debug.Log("E");
    73.         ConfigManager.FetchConfigs<userAttributes, appAttributes>
    74.                  (new userAttributes(), new appAttributes());
    75.  
    76.         Debug.Log("F");
    77.     }
    78.  
    79.     //TODO If Awake doesnt fetch a value then we might have to check again after some time to fetch fresh set of values
    80. }
    81.  
    Screenshot 2021-07-19 at 9.37.27 PM.png
     
  9. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    In Play mode? So this only happens when running in the Editor, and not on a device? The original post mentioned Android as the target platform. What is "GetStacktrace(int)"
     
  10. cryogee

    cryogee

    Joined:
    Aug 6, 2009
    Posts:
    132
    If I enable Full as shown below then "GetStacktrace(int)" appears in log messages trace
    I have not tested it on device yet but my build target is set to iOS

    Screenshot 2021-07-19 at 10.14.57 PM.png
     
  11. ramsayamarin

    ramsayamarin

    Joined:
    Feb 10, 2013
    Posts:
    16
    I have only tested it on the editor, latest Unity version on Windows 10. This is the code that initiates the whole process:
    Code (CSharp):
    1. using Sirenix.OdinInspector;
    2. using Unity.RemoteConfig;
    3. using UnityEngine;
    4. using UnityEngine.Events;
    5. using UnityEngine.Serialization;
    6.  
    7. namespace Common.Utilities
    8. {
    9.     class ConfigFetcher : MonoBehaviour
    10.     {
    11.         public static ConfigFetcher Instance { get; private set; }
    12.  
    13.         public bool IsFetching { get; private set; }
    14.         public int FetchCount { get; private set; }
    15.         public float LastFetchTime { get; private set; }
    16.  
    17.         [Required] [SerializeField] private string _environmentId;
    18.  
    19.         public struct UserAttributes
    20.         {
    21.         }
    22.  
    23.         public struct AppAttributes
    24.         {
    25.         }
    26.  
    27.         private void Awake()
    28.         {
    29.             if (Instance == null)
    30.             {
    31.                 Instance = this;
    32.                 ConfigManager.SetEnvironmentID(_environmentId);
    33.                 ConfigManager.FetchCompleted += ApplyRemoteSettings;
    34.                 Fetch();
    35.             }
    36.             else if (this != Instance)
    37.             {
    38.                 Destroy(gameObject);
    39.             }
    40.         }
    41.  
    42.         private void OnDestroy()
    43.         {
    44.             ConfigManager.FetchCompleted -= ApplyRemoteSettings;
    45.         }
    46.  
    47.         public void Fetch()
    48.         {
    49.             if (IsFetching)
    50.             {
    51.                 return;
    52.             }
    53.  
    54.             IsFetching = true;
    55.             ConfigManager.FetchConfigs<UserAttributes, AppAttributes>(new UserAttributes(), new AppAttributes());
    56.         }
    57.  
    58.         void ApplyRemoteSettings(ConfigResponse configResponse)
    59.         {
    60.             FetchCount++;
    61.             LastFetchTime = UnityEngine.Time.realtimeSinceStartup;
    62.             IsFetching = false;
    63.         }
    64.     }
    65. }
    The error also appears elsewhere, when I opened the Remote Config windows and pushed an update while the players wasnt running:
    Code (CSharp):
    1. [Error] A Native Collection has not been disposed, resulting in a memory leak. Allocated from:
    2. Unity.Collections.NativeArray`1:.ctor(Byte[], Allocator)
    3. UnityWebRequest.Put()
    4. Unity.RemoteConfig.Editor.<_PutConfig>d__64.MoveNext() at Library\PackageCache\com.unity.remote-config@2.0.1\Editor\RemoteConfigWebApiClient.cs:385
    5. 383:   string url = string.Format(RemoteConfigEnvConf.putConfigPath, cloudProjectId, configId);
    6. -->385:   var request = Authorize(UnityWebRequest.Put(url, payload));
    7. 386:   yield return request.SendWebRequest();
    8. RemoteConfigWebApiClient.UpdateCoroutine() at Library\PackageCache\com.unity.remote-config@2.0.1\Editor\RemoteConfigWebApiClient.cs:819
    9. 817:   if (m_webRequestEnumerator.Current == null)
    10. 818:   {
    11. -->819:       m_webRequestEnumerator.MoveNext();
    12. 820:   }
    13. 821:   else if (m_webRequestEnumerator.Current.isDone)
    14. RemoteConfigWebApiClient.Update() at Library\PackageCache\com.unity.remote-config@2.0.1\Editor\RemoteConfigWebApiClient.cs:807
    15. 805:   private static void Update()
    16. 806:   {
    17. -->807:       UpdateCoroutine();
    18. 808:   }
    19. EditorApplication.Internal_CallUpdateFunctions()
    I believe it has to do with UploadHandlerRaw not being wrapped inside a using statement. Any comment on that idea?
     
  12. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    It's possible, we will take a look
     
  13. ramsayamarin

    ramsayamarin

    Joined:
    Feb 10, 2013
    Posts:
    16
    Any updates? I'm still getting exceptions every time I run my app.
    I actually know the solution, add IDisposable interface to RCUnityWebRequest and in ConfigManagerImpl.cs function DoRequest() wrap var request = new RCUnityWebRequest(); inside a using statement. I did it myself but everytime I run my game it resets the code since it is inside a unity package. Can you please update the package ASAP or let me know how to prevent my edits from being overwritten by unity?
     
    Last edited: Sep 3, 2021
  14. wilczarz_84

    wilczarz_84

    Joined:
    Jan 6, 2017
    Posts:
    11
    I am also observing this all the time.. it's very annoying. Can you fix this please?
     
  15. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you confirm it's only showing in the Editor, not on devices, and not a crashing error?
     
  16. wilczarz_84

    wilczarz_84

    Joined:
    Jan 6, 2017
    Posts:
    11
    Hi Jeff! I confirm - no crash, it happens in the editor only.
     
  17. wilczarz_84

    wilczarz_84

    Joined:
    Jan 6, 2017
    Posts:
    11
    Hi Jeff, is there already an issue created on issue tracker for this problem? When do you think you can get it fixed?
     
  18. tagh

    tagh

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    22
    Hi @ramsayamarin

    We're taking a look at this bug. In regards to your question to having a version of the package that will not be overwritten when you make a change to the code; I believe you can change the reference to the current installed version of the Remote Config package by referencing the local filesystem path and adding it locally from the Package Manager UI: https://docs.unity3d.com/Manual/upm-ui-local.html

     
  19. wilczarz_84

    wilczarz_84

    Joined:
    Jan 6, 2017
    Posts:
    11
    Guys are you planning to post some update here in this thread? Or it's just going to get fixed in some upcoming release?
     
    avataris-io likes this.
  20. tagh

    tagh

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    22
    Hi @wilczarz_84 don't have anything to report currently. We will update on this forum thread when we have a patch you can apply, and expected release for a package containing the fix
     
  21. DryreL

    DryreL

    Joined:
    Feb 23, 2020
    Posts:
    37
    Same problem here.
     
  22. avataris-io

    avataris-io

    Joined:
    Jun 23, 2020
    Posts:
    23
    Same problem
     
  23. Enzi

    Enzi

    Joined:
    Jan 28, 2013
    Posts:
    831
    3 months later, leak is still happening.

    Traced back to "internal void DoRequest(string jsonText)" which does in fact, not Dispose.

    Fix: Copy com.unity.remote-config@2.0.1 from Packages folder into a LocalPackage folder somewhere outside of the Asset folder.
    Add this package in Package Manager via "Add package from disk"
    Edit the file: "Runtime/ConfigManagerImpl.cs" and add the highlighted line of code.

    upload_2021-10-5_17-23-55.png

    P.S.: You should mark your Remote Config package as experimental. Obviously it has seen NO testing when such basic bugs occur.
     
    oigetinthevan and Timboc like this.
  24. tagh

    tagh

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    22
    Hello on this issue, we currently have a new version of the Remote Config Package which we are working on testing with, and expect to release next week. The new version will be 2.1.2 and contain updates which will bring the package UI inline with our current service, and as well contains a fix for this bug. I will post back when the package is publicly released.
     
  25. tagh

    tagh

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    22
    The 2.1.2 Version which addresses this bug has been publicly released. You can safely update to that version to correct the issue.
     
    oigetinthevan and vd_unity like this.
  26. oigetinthevan

    oigetinthevan

    Joined:
    Aug 1, 2018
    Posts:
    6
    Hiya,

    2.1.2 doesn't seem to be appearing in the package manager for me. Has anyone else had any luck?

    I'm running Unity version: 2021.1.15f1.2775

    Thanks again

    upload_2021-10-20_22-33-49.png
     
  27. tagh

    tagh

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    22
    The Package Manager UI is locked down in the 2021 Editor as far as exploring the various package versions. I have attached a public doc here for how to install a specific package version (Remote Config 2.1.2) depending on the editor version you are using.

    TLDR; for 2021.1 you need to manually edit the package manifest.json file to version @2.1.2; this will be the default version once 2021.2 is released.

    https://docs.google.com/document/d/1JJkvle_kAkrP4kn6t4i90R9QrXUv4_jQy5wfNJ1JXI4/edit?usp=sharing
     
    oigetinthevan and JeffDUnity3D like this.
  28. oigetinthevan

    oigetinthevan

    Joined:
    Aug 1, 2018
    Posts:
    6
    Worked a treat. Thanks for putting that guide together, Tagh!

    upload_2021-10-22_23-51-51.png
     
    JeffDUnity3D likes this.
  29. takizava_a

    takizava_a

    Joined:
    May 6, 2020
    Posts:
    1
    Hey guys!
    upload_2022-1-23_8-0-7.png
    I got this error
    Unity 2021.1.27f1
    Remote Config 2.1.2 version
     
  30. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please try with 3.0.0-pre.9
     
  31. cactus170

    cactus170

    Joined:
    Apr 11, 2019
    Posts:
    4
    Code (CSharp):
    1. /// <summary>
    2. /// Fetches an app configuration settings from the remote server passing a configType.
    3. /// </summary>
    4. /// <param name="configType">A string containing configType. If none apply, use null.</param>
    5. /// <param name="userAttributes">A struct containing custom user attributes. If none apply, use null.</param>
    6. /// <param name="appAttributes">A struct containing custom app attributes. If none apply, use null.</param>
    7. /// <param name="filterAttributes">A struct containing filter attributes. If none apply, use an empty struct.</param>
    8. public async Task<RuntimeConfig> FetchConfigsAsync(string configType, object userAttributes, object appAttributes, object filterAttributes)
    9. {
    10.     if (string.IsNullOrEmpty(configType))
    11.     {
    12.         configType = "settings";
    13.     }
    14.  
    15. .....
    16.  
    17.     else
    18.     {
    19.         configResponse = ParseResponse(ConfigOrigin.Remote, request.GetResponseHeaders(), request.downloadHandler.text);
    20.     }
    21.  
    22.     if (!configs.ContainsKey(configType))
    23.     {
    24.         configs[configType] = new RuntimeConfig(configType);
    25.     }
    26.  
    27.     appConfig = ConfigManager.GetConfig(configType);
    28.     configs[configType].HandleConfigResponse(configResponse);
    29.     FetchCompleted?.Invoke(configResponse);
    30.  
    31.     request.Dispose(); <== HERE?
    32.  
    33.     return configs[configType];
    34. }
     
  32. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Did you have a question? If you are having issues, you would likely want to start with the recommended code here https://docs.unity3d.com/Packages/com.unity.remote-config@3.0/manual/index.html. If you are seeing the memory leak issue, this has been addressed in recent RC versions. The latest is 3.0.0-pre.15
     
    cactus170 likes this.