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
0
Question by RobBrooks · Nov 22, 2013 at 02:09 PM · iosmemoryprofilermemory-leakipod

Object references listed in profiler but not in hierarchy.

Ok, here's the thing.

Memory usage when starting game and entering a certain page of the shell GUI <> 150MB.

All object references at this point make complete sense. Everything that's there can be accounted for in the current context.

I enter the game and then immediately quit and return to the shell GUI page I was at previously. I check the memory usage and it's risen by 30MB.

I check the referenced objects. MANY of these are now from the in-game scene with reference counts of 1 or a few which can be attributed to their own internal components, but NO references from the current hierarchy which is now reflecting the expected state of the front-end scene.

I'd REALLY like to get my memory usage at this point back down to where it was before I entered the game because this overhead is causing issues on low-spec devices like the iPod touch 4G and original iPad.

So if anyone can suggest any strategies for finding where the root of this inconsistency lies, that would be amazing.

Thanks in advance.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by aeau2012 · Nov 22, 2013 at 02:55 PM

Hey RobBrooks, are you making instances of prefabs in the other scene? if it so, are your instance in the folder Resources?

If the answer is yes, then at the start of your scene of GUI, you should put:

Resources.UnloadUnusedAssets();

This will unload all the assets that are not being used, for they to be unused, unity goes trough all your gameobjects in the hierarchy, if the assets are not there unity unloads http://docs.unity3d.com/Documentation/ScriptReference/Resources.UnloadUnusedAssets.html

and then force the garbage collector to pass to remove all this accumulated memory:

System.GC.Collect();

If the answer is that your instance are not from Load.Resources, then you should start doing it as a good practice.

Hope this help you!

Comment
Add comment · Show 1 · 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 RobBrooks · Nov 22, 2013 at 03:48 PM 0
Share

Thanks for the reply aeau2012

I A$$anonymous$$ already using that method for clearing things away after reloading the shell front end BUT a lot of the assets that are used in game, in fact, $$anonymous$$OST, are NOT stored in the Resource folder.

I'll have to have a word with the $$anonymous$$m and find out why that decision was made and see what I can do to correct things, so thanks very much for the headsup.

I am wondering though........ is there no other way of applying the same mechanism that Resources.UnloadUnusedAssets() uses to clear away all those other objects?

I'm not looking for an easy-out as much as I am wishing to find out more about the difference in the way that files are managed in each case.

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

17 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

Related Questions

Memory Leak Help 2 Answers

Performance going down over time 2 Answers

Unloading asset bundles doesn't clear memory on iOS 1 Answer

"Real Memory" usage in iOS expands the more often one prefab is referenced in the assetbundle 0 Answers

iPad real memory accumulation, how to prevent this? 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