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 Jean-Fabre · Mar 04, 2011 at 12:25 PM · iosmemoryipadmemory-leak

iPad real memory accumulation, how to prevent this?

Hi,

Currently running my app under Performance tools Activity checks and looking at the Real Memory entry.

It keeps accumulating as I load levels, Levels have more or less the same amount of textures and code, so why does the real memory accumulates. I don't load additive, I simply load a new level (Application.LoadLevel). The amount of gameObject not destroyed within the entire application is constant.

It seems that when a memory warning is issued, it cleans a bit , but it's never back to the start up value or anywhere close.

Am I missing something really obvious?

I though that Application.LoadLevel() was the best way to manage memory consumptions.

Thanks for your insight,

Bye,

Jean

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
6
Best Answer

Answer by Jean-Fabre · Mar 11, 2011 at 03:17 PM

Hi,

I found that loadLevel do not release assets properly for the garbage collector to to its work when needed, and in the troubleshooting page, they mentionned loadLevelAdditive as an alternative and it works reliably.

1- load an empty scene using loadLevel() ( a special scene with nothing in it) 2- load your actual scene additively using LoadLevelAdditive() 3- I just call UnloadUnusedAssets just to force things. it might not be required tho.

in effect, this equal loadLevel(), but now, the app is 100% stable and I don't get any memory warnings like when just using loadLevel() only.

Hope it helps,

Jean

Comment
Add comment · Show 7 · 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 Joshua · May 09, 2011 at 05:50 AM 0
Share

Thanks for sharing the answer.

avatar image Voronoi · Aug 02, 2012 at 06:26 PM 1
Share

This worked for me too. XCode was reporting that it was unloading hundreds of unused objects, but the Objects Now kept increasing with every level. It is still unloading a lot, but the Objects Now is staying where it should be - around 100-300. $$anonymous$$emory in use went from constantly increasing up to 5.9$$anonymous$$B to a stable 1.5$$anonymous$$B per level loaded.

Thanks!

avatar image mtusan · May 24, 2013 at 10:40 AM 1
Share

Thanks $$anonymous$$! Just one more question if you don't $$anonymous$$d.

Do you load your special empty scene first and then you load your actual scene Additively from that empty scene (well not empty but with one GO with "Application.LoadLevelAdditive" script)?

Or do you load both scenes at once (from your current scene) like it is in the scripting reference?

 // Loads empty scene
 Application.LoadLevel ("EmptyScene");
 // Add items from the level named "ActualSceneWhereIWantToGo".
 Application.LoadLevelAdditive ("ActualSceneWhereIWantToGo");

Hopefully someone can make this clearer to me. Thanks!

avatar image fanling3 · Aug 07, 2013 at 09:19 AM 1
Share

Anyone can clarify this?

avatar image 3Duaun · Sep 09, 2013 at 12:16 AM 0
Share

Is this issue still present in Unity 4.x?

Show more comments

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

6 People are following this question.

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

Related Questions

mp3 files giving ios memory warning 0 Answers

Object references listed in profiler but not in hierarchy. 1 Answer

Memory Allocation Continues to Grow? iOS. 4.6.3 0 Answers

How do I destroy things properly to free up memory? (iOS) 3 Answers

[iOS Memory Question] At ~35MB of memory on a heavily multitasked iPhone4/iPad we are getting suspend-crashes after lowmemory warnings. Is there anything we can do? 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