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
1
Question by Slight0 · Nov 16, 2014 at 07:20 PM · crashmemory-leakvideo memory

VRam keeps climbing until Unity editor crashes.

The editor's statistics read "VRAM Usage: 8 mb of x mb (of unknown)" and that x number keeps climbing all the way to 1.34 gb where it crashes the entire editor. I'm assuming for some reason the game is exhausting video memory but I can't see why.

My game generates meshes from voxel data then destroys and recreates the mesh when it needs to be regenerated.

The meshes get destroyed by calling Destroy() on their gameobjects. What could be causing this apparent memory leak?

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
1
Best Answer

Answer by Bunny83 · Nov 16, 2014 at 07:26 PM

Do you actually destroy the mesh? i guess not. You also should use the sharedXXX properties in most cases. If you create a distinct mesh manually, assign it to .sharedMesh instead of .mesh as mesh will duplicate the mesh. A Mesh instance could be shared between multiple objects, so you should destroy it with Destroy when done.

Comment
Add comment · Show 2 · 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 Bunny83 · Nov 16, 2014 at 08:02 PM 0
Share

Just to make that clear: $$anonymous$$eshes are managed objects by the Unity engine. Like all objects derived from UnityEngine.Object they aren't destroyed when you get rid of all references since they are managed. They can still be found with FindObjectsOfType. You have to destroy the $$anonymous$$esh objects manually. Each $$anonymous$$esh object represents a VBO (vertex buffer object). This count should also increase in your stats because everytime you create a new $$anonymous$$esh, a new VBO is created.

So either destroy them completely, or use a chunk-pool where you reuse the whole chunk (including GameObject and mesh).

avatar image Slight0 · Nov 16, 2014 at 10:35 PM 0
Share

I was using shared$$anonymous$$esh and it turns out that you have to destroy the $$anonymous$$esh object directly. It's not enough just to destroy the game objects that reference it. 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

27 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

Related Questions

iOS crashing between scenes, memory problem? 0 Answers

iOS crash problem: Received memory warning . How to solve that? 1 Answer

Unity iOS 13 Memory leak Crash 3 Answers

Unity app crashes on iOS on startup 1 Answer

Application crashes after seven hours ! 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