- Home /
Game closes unexpectedly
I'm creating a game in 2D, it runs perfect on devices with 1GB of RAM, but on lower devices, with 512 RAM the game starts but after seconds it closes alone.
I've already reduced the textures, maybe it might have something to do with tris or verts but I'm not sure.
My version is 2017.1.0f3, thanks any help possible.
EDIT: The fact is that my mobile device has 512 RAM and not my computer, when the game is played on my (cell phone) it happens that this problem of the game comes out inexpertly.
I already tested the game in 1GB RAM device and it did not give this problem, interesting to say that the design is light has 27 mb, there are no light effects, shadows, it also has background music.
If you run the app from xcode or Android Studio, you can use the IDE profiler in there.
Personally I came back again, after exa$$anonymous$$ing the scripts through the Profile, and remove possible errors or bottlenecks, still the game closes after 7-15 seconds after being initialized in the android phone ..
Any other suggestions on this case? Thank you
Answer by tanoshimi · Aug 20, 2017 at 08:22 AM
Well, you're probably running out of memory but there really isn't enough information to be able to say more than that (and 512Mb is really a very small amount of memory - how many of your target devices only have that?).
You need to use the Profiler to determine where your memory is being allocated.
It seems that I found the problem, I followed the comment of tanoshimi and when using Profiler I discovered that the allocated memory exceeded 590 $$anonymous$$b, due to a script that I am lapping to try to break this abuse of memory, I believe it is some loop in the code , Perhaps Time.deltaTime.
Thanks for the help, friends.
Answer by aquilis007 · Aug 26, 2017 at 10:14 PM
Now I found the cause of this disorder, the big problem was that my cell that had this error of leaving the game alone, had some applications running, which consumed RAM of the device, consequently I had only a few free RAM's, which was not enough to run my game.
SOLUTION: Stop the application process that is not necessary, or it is not used in the background, (this can be done in the storage settings of the device), so it will free up memory space. Of course, remember that the less memory your Game need to run, less problem will have so I am working to further reduce weight in memory.
Your answer
![](https://koobas.hobune.stream/wayback/20220612133122im_/https://answers.unity.com/themes/thub/images/avi.jpg)