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
2
Question by dwn · Nov 23, 2012 at 07:27 AM · iosassetsmemoryresources

Memory overhead associated with assets in Resources

We have our game set up to load different assets (usually textures) depending on the iOS device we're running on. These assets are specified by path in the object that uses them, then one is chosen at run time and loaded via Resources.Load( ... ).

That seems to work fine.

As we've added new assets to the Resources directory, however, the baseline memory use of our game is increasing. It seems that just having additional assets inside Resources is causing more memory to be used, even when those assets are not loaded. Purging assets with Resources.UnloadUnusedAssets( ... ) does not recover that memory.

All my memory measurements are done inside Apple's memory monitor instrument.

Does anyone know what could be going on here? Is this the proper/best/only way to dynamically choose which assets to load?

Update

The extra memory is tracked by the Allocations instrument, which reports an additional ~5M and ~46,000 allocations when these assets are in the Resources folder. That would apparently rule out textures or other render data that isn't reported by that instrument.

Comment
Add comment · Show 5
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 Jessespike · Nov 23, 2012 at 07:38 AM 0
Share

You may have references that is causing additional assets to load than intended. Do you prefabs linking to other prefabs? I had a similar issue once before and removing the references fixed it.

avatar image dwn · Nov 23, 2012 at 09:05 AM 0
Share

I'm seeing the increase in memory use before loading any of the new assets or prefabs that reference them. Just having them in the resources directory seems to incur some memory overhead.

II'll definitely be doing further testing and I'll post anything else I find.

avatar image JonC · Dec 04, 2012 at 09:47 PM 0
Share

Did you have any luck figuring out why this was happening?

avatar image dwn · Dec 06, 2012 at 07:16 PM 0
Share

Apparently Unity creates a large lookup graph for everything stored in Resources (in a file called 'mainData'). That graph is always loaded and can potentially take up a lot of memory--substantially more than the file size alone would suggest.

avatar image waspfarmer2 · Jan 30, 2013 at 03:40 PM 0
Share

dwn, is there any documentation to back that up?

0 Replies

· Add your reply
  • Sort: 

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

13 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

Related Questions

Prevent Resources class from loading assets when application starts 1 Answer

ResourceManager Class Referencing Assets? 1 Answer

Best way to manage hundreds of materials? 1 Answer

Memory problem. How do I dump a Streaming Asset from memory? 1 Answer

Loading a Random Resource in a Folder Without Using Resources.LoadAll 0 Answers


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