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
0
Question by splash28 · Aug 12, 2011 at 11:03 PM · androidcrashdebugadb

Android app crashes after 15 mins of play. Too many open files.

Any idea on this? Any help would be greatly appreciated.

Unity 3.4 Android Basic, Galaxy S. The game is a simple one, more like a picture viewer. It has some buttons (cubes), UI elements (labels) and a very simple AI. It does have save game functionality, but only when the player advances a level.

After playing around 10-20 minutes it blinks (or not even blinks) and whoops it disappeared. (Crashed eventually.) In case of every 'death' the game was cc. idle. (I was thinking.)

adb logcat has the following not too verbose information (//comments by me)

 I/Unity   (13928): UnityEngine.Debug:Log(Object) //Debug.Log...
 I/Unity   (13928): msgAPI:setText() //setting the label of a text in msgAPI script
 I/Unity   (13928): msgAPI:FixedUpdate() //msgAPI's FixedUpdate function
 I/Unity   (13928):  
 I/Unity   (13928): (Filename: /Applications/buildAgent/work/8xxxxxxxxxxx52/Runtime/Export/Generated/UnityEngineDebug.cpp Line: 34)
 
 I/Unity   (13928):
 E/dalvikvm-gc(13928): Could not create 1196032-byte ashmem mark stack: Too many open files** 
 
 E/dalvikvm-heap(13928): dvmHeapBeginMarkStep failed; aborting
 
 E/dalvikvm(13928): VM aborting
 
 D/Zygote  ( 3172): Process 13928 terminated by signal (11)//Dies



I guess the culprit is somewhere around the "too many open files" error. But what could this mean? I only have textures loaded via the editor (ie no streaming assets). So ok maybe it's due to some parts of the program... but... I only user primitive variables, a few classes and a few built-in arrays.

Also... objects are not created in any of the Update/FixedUpdate functions, the only problem I could imagine if I created objects too fast (like in an update) and the GC couldn't deal with it.

PS.: One thing came to my mind. Is it legal to use renderer.material.SetTextureOffset("_MainTex", somethingVector2) at will? Or does it go into file reading when called?... Erm, I'm out of ideas atm.

Update: I wrote a script so my PC played the game in the Editor's Play window. The game ran w/o errors for 1 hour+. Now I'm puzzled.

Comment
Add comment · Show 5
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 Waz · Aug 14, 2011 at 12:11 AM 0
Share

If you are not opening files (including network accesses), then I'd suspect a bug in Unity that you're tripping with something novel that you are doing. If you can narrow down what you're doing, Unity would probably love to have the bug report.

Certainly changing the texture offset is not unusual, so I'd not suspect that. Does it crash if you don't actually play but just sit there idling in the game (you may need to change your game rules to test that of course)? If so, that narrows it down to just the update functions that would be executing while idling (such as your suggestion about the UV animation).

One thing I'd suspect: do you change a PlayerPrefs variable all the time? You should be allowed to of course.

avatar image Waz · Aug 14, 2011 at 12:14 AM 0
Share

Another thing I'd suspect is logging. Try to get rid of any continuous logging (you should do that anyway), to see if that fixes it.

avatar image splash28 · Aug 14, 2011 at 02:51 PM 0
Share

Thanks for the comment, I will try to eli$$anonymous$$ate the many Debug.Log calls, and no it doesn't crashes on its own (without actually playing) and no I don't change the PlayerPrefs variable at all. I will let you know what happened, thanks again.

UPDATE: It DOES crashes when leaving idle and setting the display to never sleep. Thanks for the tip, will post more updates later.

avatar image splash28 · Aug 14, 2011 at 10:56 PM 0
Share

Sigh. It looks like that leaving the game on its own even on the splashscreen level reproduces the same phenomenon.

FYI the splash screen level has like zero code. Update 2: Tested it with my test unity project, it dies after 20 $$anonymous$$s too. Now testing it with Papertoss to see if my telly is the culprit.

avatar image splash28 · Aug 15, 2011 at 10:07 AM 0
Share

Papertoss didn't crash. It seems my phone doesn't like Unity or vica versa.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by splash28 · Aug 15, 2011 at 01:26 PM

I think I've found somewhat of an answer. It was (is) building in development mode. (Player settings.)

For some reason even the simplest project crashed on my phone IF it had something to do with textures. Ie. make a cube, put a texture on it, take a Texture2D array with around 12 textures and 'animate' it with this:

 var frames : Texture2D[];
 var framesPerSecond = 10.0;
 
 function Update () 
 {
     if (Input.GetKey(KeyCode.Escape)) Application.Quit();
     var index : int = Time.time * framesPerSecond;
     index = index % frames.Length;
     Debug.Log("index == " + index);
     renderer.material.mainTexture = frames[index];
 }

On my Galaxy S it will always crash after 15-20 minutes if you build this project w/development mode on.

Comment
Add comment · Show 4 · 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 Waz · Aug 15, 2011 at 09:58 PM 0
Share

Are you sure that isn't because of the 36000 Debug.Logs (if it gets 60 FPS)? Presumably they are a no-op in a non-dev build.

avatar image splash28 · Aug 15, 2011 at 11:35 PM 0
Share

I will test that too, ty for the tip, but since it's 2 am here, that's work for tomorrow. :)

avatar image splash28 · Aug 20, 2011 at 07:46 PM 0
Share

I've tested it and the app, compiled with one scene, with one script in it

 function Update()
 {
     if (Input.Get$$anonymous$$ey($$anonymous$$eyCode.Escape))
     {            
         Application.Quit();
     }
 }

dies after cc. 20 $$anonymous$$utes if it's built with development mode. Anyway, non-dev mode was an adept workaround for me.

avatar image Waz · Aug 20, 2011 at 10:51 PM 0
Share

(If you haven't already, be sure to report to Unity)

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

Invalid Indirect reference in decodeIndirectRef. VM aborting. 0 Answers

Android build crashes on launch. 2 Answers

Unity 2017 frame rate capped? 2 Answers

Unity crashes without debugging 0 Answers

Debugging an Android device from Visual Studio 2019 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