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
1
Question by SovietAlex · Dec 27, 2017 at 04:47 AM · androidbuildlag

Why does my Android phone have Lag Spikes (Sometimes)?

I have a Galaxy S4 Mini.


I am developing my unity app.


I build the app and run it on my phone.


Every time I try to play right after building I have lag spikes every seconds. The game runs smoothly, I would say 40-50 fps.


I run the app after 1 minute, I cleared cache, ram, data. And still I get lag spikes.


I stop the app and clear cache and data and ram. I wait say about 30 minutes and try running the app again, and BAM it runs smoothly with no lag spikes.


WHY?

Comment
Add comment · Show 1
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 donnielo · Apr 02, 2018 at 11:34 AM 0
Share

I hope someone has an answer to this question. I am also running into a similar issue.

I have three devices, on one of those (Huawei P7) it has large lag spikes every seconds. I can clear cache and data, but this does not seem to help. Then in some strange way after waiting a while it runs perfectly.

One thing I observed is that it starts at the unity splash screen. So the issue is there from the start of the application.

note: On the other devices I do not have this issue, so you would think it is an issue with my Huawei P7. But other games run just fine on the device.

I hope someone can help us out :)

$$anonymous$$

2 Replies

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

Answer by meat5000 · Apr 02, 2018 at 11:48 AM

You Android phone has a lot going on. You can make the best performing app in the world and if Android OS wants the resources, your game is getting throttled. No two ways about it.

Follow instructions to get the profiler running for your Android build or use LogCat to see whats going on. The chances are you are using something which presents a struggle for lower-end devices which doesnt show as a problem on others. Different hardware shows different characteristics.

This link could be outdated but you get the idea

https://answers.unity.com/questions/32368/how-do-i-profile-on-an-android-device.html

~

I think the Splash screen runs simulaneously to the Start methods of the first existing gameobjects (could be awake). Check your start and awake methods for coroutines that may continue through the whole game or situations in which multiple coroutines may run. Lag spikes also can occur from large amounts of regular GameObject Instantiation and Destruction; Garbage Collection will put eveything on hold until it has run.

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 donnielo · Apr 03, 2018 at 12:30 PM 0
Share

Thank you for your answer. I will definitely look into your advice. :)

avatar image
0

Answer by SovietAlex · Apr 09, 2018 at 01:23 PM

Thanks for the the answer but I figured it out. My phone has Android Version 4.4.4 and I tried my game on 5 different phone with Version 5.0 and above and it worked just fine. So I am 100% sure it is the phone.

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

160 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 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 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 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 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 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 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Distribute terrain in zones 3 Answers

Android Build Lagging 0 Answers

Unity to android (game very laggy) 1 Answer

Game too slow or too fast on Android 1 Answer

Build game moves incredibly fast and blurry 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