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 Josh 4 · Nov 06, 2010 at 06:10 PM · buildmemorybuildpipelinebuildplayer

Build Fails Due To Unity Crash: Out Of Memory

I am running an automated build system using Unity 3.0 Pro on a dedicated server (Mac Pro with 2 quad core Xeons, 16 GB RAM) which autobuilds standalone Windows and OS X Universal players my project every hour as a cron job. This has worked quite well for the past several months, but a few days ago I started getting an "out of memory" message when a normal build was being attempted. Memory use balloon up to ~3 GB and that's the point at which Unity normally crashes. Occasionally it will get to the point of building the players, once again memory use balloons up to ~3 GB, and at that point it will hang up and progress no further.

The code in script (omitting personal information like passwords and such) I am using to build my project is as follows:

/Applications/Unity30/Unity.app/Contents/MacOS/Unity -batchmode -quit -projectPath /path/to/my/project -executeMethod ProjectBuilder.PerformBuild -assetServerUpdate myAssetServer myProjectName myUsername myPassword

The relevant code in ProjectBuilder.PerformBuild is (once again changing some names so it make more sense) as follows:

BuildPipeline.BuildPlayer(sceneToIncludeInBuild, "WindowsBuild.exe", BuildTarget.StandaloneWindows, BuildOptions.Development); BuildPipeline.BuildPlayer(sceneToIncludeInBuild, "OSXBuild.app", BuildTarget.StandaloneOSXUniversal, BuildOptions.Development);

If anyone has run into a similar issue I would welcome some input.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Josh 4 · Dec 02, 2010 at 02:14 PM

I actually found a way around this several weeks ago. Turns out that the build script isn't necessary if you just want to make a build using the project settings you've set up in the editor. You can use either or both of these command line options: -buildWindowsPlayer path/to/your/build.exe -buildOSXPlayer path/to/your/build.app

Usage, using a modified version of my previous code, is as follows:

/Applications/Unity30/Unity.app/Contents/MacOS/Unity -batchmode -projectPath /path/to/my/project -assetServerUpdate myAssetServer myProjectName myUsername myPassword -buildWindowsPlayer path/to/your/build.exe -buildOSXPlayer path/to/your/build.app -quit

This seems to avoid the problem of having too many assets in the Resources directory. My project has continued to grow and the resolution has endured. These command line options have apparently been in Unity since version 1.0, but they aren't officially documented at this point. Similarly adapting your build process would help you avoid similar problems in the future. It certainly has for me.

Comment
Add comment · Show 1 · 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 Josh 4 · Dec 02, 2010 at 02:55 PM 0
Share

It would really have helped if this had been documented with the rest of the command line options. It makes me wonder what else is possible that hasn't been documented.

avatar image
0

Answer by Ludovic · Dec 01, 2010 at 03:33 PM

Don't know if you are still stuck by this time but we had a similar problem.

We resolved it when we realized that every asset that is in the Resources folder is built in the player, since it can be loaded everywhere from the code.

Remove assets from the Resources solved our problem.

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

No one has followed this question yet.

Related Questions

Building Unity from Batch file using Node.js 0 Answers

How do I define ScriptDefines from either the command line or with executeScript 1 Answer

Distribute terrain in zones 3 Answers

Build failed with errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer 0 Answers

Build hang on compiling scripts in Unity 2018.2 2 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