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 /
This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by sooncat · Jun 19, 2012 at 07:52 AM · wwwmemory-leak

Memory Leak by www?

My test code here:

 IEnumerator StartDownLoad(string url)
 {
     WWW www = new WWW(url);
     yield return www;
     www.Dispose();
     www = null;
     Resources.UnloadUnusedAssets();
 }

Run in webplayer(IE8/Firefox) and I find that :

after the function was called, the memory cost increased 30M+ in Windows Task Manager.

(the url points to a big assetbundle)

Why is the memory increased after dispose?

Is there any thing wrong in my code?.

(In Unity IDE, the memory show in Profile dose not changed after the function called)

Comment
Add comment · Show 18
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 coder8 · Jun 19, 2012 at 08:20 AM 0
Share

You may need to post the code that calls that function. It could be getting called repeatedly or not making it to the Dispose. Also be careful about using the task manager to judge how memory if being used in an application. Unity may need to load extra stuff when it uses www and then it keeps it "hot" so it doesn't have to load it again if you use that function. I don't really know that it does that but it is just to illustrate that A LOT of stuff is done with RA$$anonymous$$ that is out of your control.

avatar image sooncat · Jun 19, 2012 at 08:27 AM 1
Share

the code to call the function is simple:

if(GUI.Button()){StartCoroutine(StartDownLoad)}

I'm sure the function was called once.(test by debug.log)

avatar image Mizuho · Jun 19, 2012 at 08:49 AM 0
Share

Does this continue after the download has completed?

avatar image sooncat · Jun 19, 2012 at 09:02 AM 0
Share

yes. the memory never decreased until i close the browser. I tried many times all get the same result.

unity vertion: 3.5.0f2 (my friend who use 3.5.2 f2 get the same result)

avatar image fafase · Jun 19, 2012 at 09:49 AM 0
Share

You could try to clean the heap with System.GC.Collect(); and see if it helps. $$anonymous$$eep in $$anonymous$$d that is quite expensive function, try to use it when you would have a break in your game.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by zzb · Jun 25, 2012 at 03:13 AM

I think you should try to use www.assetBundle.Unload(true);

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

10 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

Related Questions

IOS memory leak because of WWW object 1 Answer

UnityWebRequest leaking memory. 2 Answers

Assetbundle memory leaks 0 Answers

Unload asset loaded with WWW class 1 Answer

how to enter another request from www with c# 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