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 Visartech · Mar 29, 2014 at 06:54 PM · assetbundlewwwloadfromcacheordownload

WWW::Dispose doesn't work

Hello,

I'm developing the game for iOS with a lot of resources, and I'm using Asset Bundles to download most of resources after player has installed the game.

When user launches the game for the first time, I'm showing a preloading scene, and executing the code like the following in order to cache the asset bundles :

 foreach (string assetBundleUrl in urls) {
     WWW www = WWW.LoadFromCacheOrDownload(assetBundleUrl, 1);
     yield return www;
     www.Dispose();
 }

For some reason www.Dispose() method doesn't clear the memory. So, caching many asset bundles makes my game crash on iPad 2.

Am I doing anything wrong? Or is this a known bug in Unity? Any ideas on how I could handle it would be helpful.

Thank you.

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 Graham-Dunnett ♦♦ · Mar 29, 2014 at 07:02 PM 0
Share

Where's WWW.Dispose documented? I don't think WWW has a Dispose member.

avatar image Visartech · Mar 29, 2014 at 07:12 PM 0
Share

I learned about downloading asset bundles from this page: http://docs.unity3d.com/Documentation/$$anonymous$$anual/DownloadingAssetBundles.html

Here using keyword is used, but in comment it's written that using keyword is a substitute for www.Dispose(). By the way I tried using using keyword, and it doesn't clear the memory too.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by StormTeam · Aug 08, 2014 at 06:42 PM

We ran into a similar issue in our app. We were loading lots of textures from WWW and noticing iOS being the only platform to have a memory leak from it. We eventually found our solution here http://forum.unity3d.com/threads/www-memory-leak-ios.227753/. Basically, there is a known issue in unity 4.3 that leaks the data from www calls. This SHOULD be fixed in unity 4.5. In the meantime, you can follow Alexey's suggestion to modify the code in the generate xcode project or update to 4.5:

will have the fix.

Essentially you need: search for extern "C" void UnityDestroyWWWConnection(void* connection) in WWWConnection.mm [delegate.connection cancel]; delegate.connection = nil; [delegate.data release]; // <-- ADD THIS [delegate release];
Comment
Add comment · 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

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

22 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

Related Questions

How to download multiple asset bundles in serial order? The error of "cant load 'name' assetbundle as it is already loaded" comes after first assetbundle download. Please help. Needed urgently! 0 Answers

LoadFromCacheOrDownload non asset bundles 1 Answer

LoadFromCacheOrDownload Version Variable Reset? 1 Answer

Save Hash128 from Asset Bundle Manifest 2 Answers

AssetBundle, problem whit the version 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