Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by elyasaf · Jun 28, 2021 at 04:21 PM · remotestacktrace

(Remote Config) Calling ConfigManager.FetchConfigs from FixedUpdate throws "A Native Collection has not been disposed, resulting in a memory leak."

I've got this Error In unity 3D after I started using Remote Config:

A Native Collection has not been disposed, resulting in a memory leak. Allocated from:

Unity.Collections.NativeArray`1:.ctor(Byte[], Allocator)

UnityEngine.Networking.UploadHandlerRaw:.ctor(Byte[])

Unity.RemoteConfig.ConfigManagerImpl:DoRequest(String) (at Library\PackageCache\com.unity.remote-config-runtime@1.0.1\Runtime\ConfigManagerImpl.cs:267)

Unity.RemoteConfig.ConfigManagerImpl:PostConfig(Object, Object) (at Library\PackageCache\com.unity.remote-config-runtime@1.0.1\Runtime\ConfigManagerImpl.cs:204)

Unity.RemoteConfig.ConfigManagerImpl:FetchConfigs(appAttributes, userAttributes) (at Library\PackageCache\com.unity.remote-config-runtime@1.0.1\Runtime\ConfigManagerImpl.cs:188)

Unity.RemoteConfig.ConfigManager:FetchConfigs(appAttributes, userAttributes) (at Library\PackageCache\com.unity.remote-config-runtime@1.0.1\Runtime\ConfigManager.cs:96)

Movement:FixedUpdate() (at Assets\scripts\Movement.cs:27)

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ravenclarico · Jun 29, 2021 at 02:29 AM 0
Share

if you look at the last line It's pointing you to a line of your own code, so maybe read that instead of giving us an unsolvable error with zero context.

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by andrew-lukasik · Jun 29, 2021 at 06:51 AM


This error says that your script Assets\scripts\Movement.cs ( at FixedUpdate) calls ConfigManager which allocates memory for networking communication and that memory wasn't deallocated.


If you see this warning only once when play mode ends I would ignore it for now. It might be temporary and minor package issue.

But if you're getting spammed with this message A LOT then to fix this you must help this ConfigManager deallocate it's memory somehow or stop calling it.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image elyasaf · Jun 30, 2021 at 09:49 AM 0
Share

and how exactly am i doing that? (deallocating)

avatar image andrew-lukasik elyasaf · Jun 30, 2021 at 09:57 AM 0
Share

And how I suppose to know what in your script at line 27, while you shared none of it's content, exactly? :T

avatar image elyasaf · Jun 30, 2021 at 10:24 AM 0
Share

Sorry... I thought its more like a principle... here is the code:

     private void Awake()
 {
 ConfigManager.FetchCompleted += UpdateData;
         ConfigManager.FetchConfigs<appAttributes, userAttributes>(new appAttributes(),new userAttributes());
 }
 void FixedUpdate()
 {
         if(Input.GetKeyDown(KeyCode.Space))
             ConfigManager.FetchConfigs<appAttributes, userAttributes>(new appAttributes(), new userAttributes());...
 }

     void UpdateData(ConfigResponse response)
     {
         ConfigManager.appConfig.GetInt("jump power");
     }

Line 27 is the content of the if statment

avatar image andrew-lukasik elyasaf · Jun 30, 2021 at 10:39 AM 0
Share

According to Remote Config's documentation page and implementation examples provided on the forum, ConfigManager.FetchConfigs is meant to be called once, for example, on Awake and definitely not on FixedUpdate. So remove it from there and you're good.

avatar image elyasaf · Jun 30, 2021 at 10:47 AM 0
Share

thanks a lot!

avatar image
0

Answer by ravenclarico · Jun 29, 2021 at 03:57 AM

you can double click the last line of the error to jump to the point in your script that caused the problem. (if you use visual studio, which i highly recommend)

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image andrew-lukasik · Jun 29, 2021 at 06:41 AM 0
Share

This is helpful only when working with a stack trace that points to your code. In this specific case will it would open ConfigManagerImpl.cs:267 file which is both foreign and won't be of much help. It's better to just understand what stacktrace says.

avatar image elyasaf · Jun 30, 2021 at 09:48 AM 0
Share

i now where the problem is i want to know how to fix it

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

156 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can iPhone remote be used from standard Unity? 2 Answers

Unity Remote 3 Problem 1 Answer

Remote Unity build? 2 Answers

Can't find unity-remote-4 in AppStore 3 Answers

How to enable head tracking in Google Cardboard via Unity Remote on OSX? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges