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 jakekosmom · Aug 24, 2017 at 02:53 AM · iosprofilinggarbage collectiongarbage collector

Why is there so much GC allocation with GameObject.Activate and Physics2D.SendTriggerContactCallbacks on iOS?

I am profiling my iOS game that has stuttering every 2-5 seconds of moving objects. I am guessing this is likely due to a drop in frame rate and have started profiling.

Here are some screenshots of spikes with GC allocation. How do I figure out which GameObject/Script is causing these issues?

Also, why do I not see VSync on iOS (it should be at 60fps)?

alt text alt text

screen-shot-2017-08-24-at-103552-am.png (242.9 kB)
screen-shot-2017-08-24-at-103539-am.png (246.3 kB)
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Aug 24, 2017 at 03:28 AM

Well activating / deactivating gameobject can be quite demanding. However it depends on what kind of object it is or specifically which components are involved. Physics objects (rigdbodies, colliders, ...) need to be added / removed to / from the physics system.

SendTriggerContactCallbacks may depend on what physics callbacks your scripts implement and how many actually receiving a callback. Also keep in mind when you don't need the callback parameter you should omit the parameter as this would avoid the creation of the collision / contact information.

I don't quite get what you mean that you "do I not see VSync on iOS".

Are you actually testing on the device using the remote profiler, or do you test in the editor?

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 jakekosmom · Aug 24, 2017 at 03:50 AM 0
Share

Thanks for the quick reply. So the GameObject that was disabled in my first screenshot is likely causing a lot of GC allocation (20.4$$anonymous$$b) due to the components that are attached to it?

By omitting the parameter do you mean not including "Collision2D other" in: void OnCollisionEnter2D (Collision2D other) { } or is there some other option, as I don't include this if I don't use it?

I have made a build on my iOS device and it automatically links the profiler when I launch the game, so I am assu$$anonymous$$g I am testing on the device, or is there some other process there? By not seeing VSync I mean why don't I see the VSync in the profiler (capping the framerate at 60fps)? Also, I am confused as to why I am seeing stuttering on the device when the profiler says that the frame rate does not go below ~100fps, which I would assume should be capped at 60fps, as I have set Application.targetFrameRate = 60; in awake.

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

91 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

Related Questions

UpdateDepthNormalsTexture 0 Answers

AssetBundle memory profiling 0 Answers

iOS profiling help 0 Answers

iOS framerate drops every 10 seconds or so... 1 Answer

Framerate drops to 40, profile says 60% in 'Overhead' 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