Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 mgoi.tbgames · Sep 22, 2011 at 12:22 PM · assetbundlememoryproceduralexceptionmemory-leak

Asset bundle memory leak and exception

Hi!

I have some problems related to unloading asset bundles. The problem is that unity leaks memory and throws the exception

Deleting persistent object without writing it first: customassetbundle-91b1e3789f272034fb2e5b6c381c4bce

Stacktrace:

 UnityEngine.AssetBundle:Unload(Boolean)
 Resource:Unload() (at Assets\Resource.cs:192)
 ResourceManager:DiscardResource(String) (at Assets\ResourceManager.cs:103)
 AssetBundleMemoryLeakTest:Update() (at Assets\AssetBundleMemoryLeakTest.cs:73)
 
 [C:/BuildAgent/work/842f9557127e852/Runtime/BaseClasses/BaseObject.cpp line 324] 
 (Filename: Assets/Resource.cs Line: 192)

when unloading an asset bundle under certain conditions.

Steps causing the exception and resulting memory leak:

  • load an asset bundle containing a prefab which has a diffuse material and no texture set

  • After loading the asset bundle, set a dynamic texture to the diffuse material (manipulate the asset bundle)

  • Create one ore more instances of the modified asset bundle game object

  • When done, destroy all instances, the dynamic texture and the asset bundle

  • This will not free all used resouces, which causes a serious problem when loading and unloading a lot of asset bundles

  • Additional to the leaked memory the given exception is thrown, each time AssetBundle.Unload(true/false) is called

I have to modify the game object before instancing it. So assigning the e.g. textures to the created instances is no option.

I am using unity 3.4.1.

I have created a little test project which reproduces the problem. It is attached to the error report:

http://fogbugz.unity3d.com/default.asp?420383_nh181n8ge0fq5u6o

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
0

Answer by jonas-echterhoff · Sep 23, 2011 at 12:45 PM

This sounds like a bug to me. Please report it using our bug reporting tool.

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 mgoi.tbgames · Sep 26, 2011 at 03:18 PM 0
Share

Thanks for your reply Jonas. A have already filed a bug report. Its the one linked in the inital post. The bug contains a simple test scene reproducing the memory leak. I would really appreciate it if you could take a look at the demo project.

Thanks.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Marching cubes Memory Leak 1 Answer

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

Memory leak using bundles. 1 Answer

Mesh memory leak 3 Answers

assetBundle.mainAsset exception 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