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 LegendaryFerret · Apr 30, 2012 at 05:15 AM · javascripteditormemory

PlayInEditor Memory Crash

I'm creating a board game in Unity and I've been having trouble with the editor crashing due to an out of memory error. I have very few GameObjects and textures at this point; most of what I have is just unityscript code. For various reasons, in part having to do with the AI, most of my work is done in classes that don't extend from MonoBehaviour.

Almost all of these classes extend from the class VirtualObject. This system was working fine until this afternoon when I added a new parameter to VirtualObject. Now when I go to run in the Editor, it consumes ~3.5gb of memory and then crashes.

This is the first part of what I believe is causing the crash.

 class VirtualObject{
 var gameParent : VirtualObject;
 var children : List.<VirtualObject>;
 var dirty : boolean = false;
 
 var objectType : ObjectTypes;
 var game : Game = null;
 var funnythinglongname: Game = null;
 }

If I comment out the line "var funnythinglongname : Game = null;" I no longer get the crash, spike memory to around 1.2 gb (which still seems nuts to me, but I'm not an expert) and can play. That line is completely unused at the moment (though I'd obviously like to use it or at the very least understand why I can't use it). Game is another class that does not extend from Monobehaviour.

If it helps, there are probably ~50 VirtualObjects hanging around in my scene after launch, all of which get created on startup. What I've listed is at least 1/3 of what they store (so none of the children are more than 3x this size).

Does anyone have a suggestion for why an unused reference on ~50 objects would cost ~2gb of RAM?

Thank you very much

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

0 Replies

· Add your reply
  • Sort: 

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

Memory Leak Adventures in Editor (3.4, lot of instantiated objects) 1 Answer

Unity says: "The System is Running out of memory." when it is not. 5 Answers

Out of memory when switching back from Monodevelop 0 Answers

Why does allocation heavy code not scale to multiple threads? 0 Answers

How to Disable Unloading of Assets During Bundling 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