Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 LorenzoValente · May 15, 2019 at 01:22 PM · scene-loadingoculusscene-switchingmemory leak

Do the scenes in Build Settings affect RAM memory on Android?

I'm having memory issues in my Android application. The setup is like this:


1) I have a Scene0 (which is very light, it contains just the camera, global application logic and managers) and it is the one that starts with the app
2) The second scene to run is Scene1, which is loaded asynchronously by a manager without deallocating Scene0 (additive mode). It is quite large and heavy.
3) The third scene, Scene2, is listed in the Build Settings "Scenes in Build" but it is NOT loaded until the user presses a button. Scene2 is totally different from Scene1 (different assets are referenced) and it is heavy aswell.


When i test the app from desktop, everything seems ok. On Android, the app crashes while it is trying to load Scene1. Logcat says it is an "out of memory" problem. Here's the strange thing: if I remove Scene2 from the Build Settings "Scenes in Build" list, Scene1 is loaded fine.

I tried to analyze the app and the Profiler (linked to the android execution) clearly shows that the Unity internal PreloadManager is asynchronously loading 1GB of assets (when Scene2 is listed in the build scenes) before Scene1 is loaded! Those assets cannot be those part of Scene1 because the app reaches the max available memory and crashes...

What does it mean? Are scenes affecting RAM memory even when they are not loaded? I'm clearly missing something. I'm 100% sure that Scene2 is not loaded by script.

I am using Unity 2019.1.2f1, deploying on Oculus Go

Comment
Add comment · Show 2
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 marketamachova · May 13, 2021 at 10:57 AM 0
Share

Hey @LorenzoValente, did you find a solution? I am experiencing the exact same issue with Unity 2019.4.23f1on an Android device and using Oculus integration within the projectt, but it is still not clear to me what might be wrong

avatar image ApexRacing · Apr 21 at 02:13 PM 0
Share

I have exactly the same problem using unity 2020.3LTS. Did you find the solution?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by JasperCiti · May 15, 2019 at 03:51 PM

Are your assets loaded from AssetBundles?

You could specify BuildAssetBundleOptions.ChunkBasedCompression or BuildAssetBundleOptions.UncompressedAssetBundle which should only load the assets in memory that are required, but from what I understood from https://docs.unity3d.com/Manual/AssetBundles-Building.html, the default behavior seems to load all assets into RAM.

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 LorenzoValente · May 15, 2019 at 03:57 PM 0
Share

Thanks you for the answer JasperCiti, no, I'm not using any AssetBundle

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

112 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

Related Questions

Whenever i load scene 2 after completing scene 1 there is a tremendous drop in fps it is showing only 0.1 fps 1 Answer

Attempting to Create an Essential SceneElements Checker 0 Answers

CheckConsistency: GameObject does not reference component Animator. Fixing. 0 Answers

Variables are resetting after loading the play scene 1 Answer

How to keep the same gameobject with different transform values in different scenes 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