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
2
Question by meustrus · Sep 06, 2011 at 10:57 PM · scenegarbage-collection

Prevent 'Cleaning up leaked objects'

I've been running into this problem with Unity 3.4 on OS X, and searching for this error message only reveals that it's supposed to be a harmless optimization. My problem is that it's NOT harmless, as the "leaked" objects are not actually leaked. Here's the full message:

 Cleaning up leaked objects in scene since no game object, component, or manager is referencing them
  X has been leaked Y times.

Here are two examples where I get this log message in relation to objects NOT in the scene being wrongfully destroyed:

  1. I have a ScriptableObject that contains an array of other ScriptableObjects which are not referred to in any other place. When saving the scene, the other ScriptableObjects disappear.

  2. I have a prefab with a dynamically built mesh. When saving the scene I get this message, and the mesh is lost from the MeshFilter component.

In all cases, I get the same message every time I save and the object(s) are not destroyed until the next play test or if the scene is reloaded. After that the objects are lost and the message doesn't appear for future saves.

My questions: How can I disable this "feature"? Is this a bug in Unity or am I doing something wrong?

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 ripol · Apr 02, 2013 at 08:37 PM 0
Share

Boum!

same problem!

avatar image sparkzbarca · Apr 02, 2013 at 09:12 PM 2
Share

you would need to write code to save objects created during runtime

by it's nature anything created during runtime exists only within the runtime scope as it were

thats not a bug. thats proper garbage collection.

if it saved it you could end up with it in memory even after the program ended clogging up resources used by the system.

It's not a bug and it should not be turned off. You should save a mesh into resources folder or something, a hard save and thereby remove it from RA$$anonymous$$ memory and keep it in the hard drive. It's not a bug it's that your trying to do it in an unsafe way.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Immanuel-Scholz · Jun 29, 2013 at 08:40 PM

I think you should look at your hideFlags for the auto-generated stuff. If you want to re-create them every time anyway, they most probably should be "`DontSave`" or even "`HideAndDontSave`".

I recommend this talk to get a found understanding of the serialization system: http://www.youtube.com/watch?v=MmUT0ljrHNc

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

6 People are following this question.

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

Related Questions

terrain game no scene 0 Answers

3d object in 2d scene 1 Answer

Asset Server Team and project management Unity Pro 2 Answers

How top create prefab with simple cube using YAML? 1 Answer

How to Merge Scene with Asset Server 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