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 evawolfe · Jul 28, 2013 at 09:04 AM · crashmemorycompilesubclassprotected

Massive memory usage during compile time

alt textHi guys,

I am currently making a game where players can select several characters in a team to fight some AI. It is a turn-based game and each character has several abilities.

As I need to make quite a number of abilities for all the different characters, I decided to create a base class called "CustomAbility" and every ability will be a subclass of "CustomAbility".

I am writing the classes in JavaScript.

In "CustomAbility", there are declarations of several "protected" variables such as

 protected var level : int = 1;
 protected var name : String = "Not assigned";

When I try to compile the script (hit save on the MonoDevelop then make the Unity main window the active window), I notice that the memory usage shoots up to 3.5GB++ until unity crashes.

However, when I comment out the declarations, Unity can compile successfully without going past 700MB in memory usage.

Anyone can help me understand what is going on? What happens during compile time that takes up so much memory?

EDIT: I did an experiment and after I moved every variable declared in the base class (for characters and abilities) to the subclasses (meaning now "CustomAbility" has no variables, but "Fireball", which extends "CustomAbility", has all the variables) Unity can compile in under 200MB.

This is very confusing to me, I would greatly appreciate anyone who could help me understand why this is the case. Thanks.

high memory usage on compile.jpg (365.2 kB)
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 Benproductions1 · Jul 29, 2013 at 01:21 AM 0
Share

Looks like a bug, you should report it :)

avatar image RalphTrickey · Jul 29, 2013 at 01:33 AM 0
Share

I agree with Ben. This is a user forum, the Unity $$anonymous$$m won't see it here.

http://unity3d.com/BugReportingFAQ

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

17 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

Related Questions

Limit on the amount of data I can store on Android Devices? 0 Answers

Crashing on Samsung S6, S6 Edge, and Galaxy Tab S 4 Answers

Instantiate fails on iPad. How can I debug memory allocation errors? 1 Answer

Unity crashes when GUI becomes too complex 1 Answer

Why my android app crashes when using RenderTexture.ReleaseTemporary? 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