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 Cool Dave · Sep 26, 2012 at 08:41 PM · graphicsframerateslow

Graphics Chopping

My framerate is good, at 40 - 80 fps, but once in a while it drops down to 3 - 5 fps, for no apparant reason. It is not caused by errors, etc., and my stats seem okay.

alt text

So I can't understand what's wrong with it. Anyone have an idea?

graphics chop.png (32.2 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

4 Replies

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

Answer by Cool Dave · Nov 12, 2012 at 10:31 PM

Figured out the problem. I had five large objects rotating to face the camera using a script called LookAt2D.js, which does the turning in a fixedUpdate. Somehow, this caused the stated behaviour.

Thanks anyways for the answers everyone.

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

Answer by shaderop · Sep 26, 2012 at 09:05 PM

It could be due to the garbage collector kicking in. Check the profiler for calls to `GC.Collect()`.

Comment
Add comment · Show 10 · 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 hvilela · Sep 26, 2012 at 10:07 PM 0
Share

He's probably right. And if he's right you're probably allocating/releasing to much. Try to make an object pool to reuse your objects.

avatar image Cool Dave · Sep 26, 2012 at 10:11 PM 0
Share

I'm not instantiating or destroying anything, although I do have those funtions in some of my scripts. Am I misunderstanding you?

avatar image Cool Dave · Sep 26, 2012 at 10:17 PM 0
Share

And isn't profiler only in Unity Pro?

avatar image hvilela · Sep 26, 2012 at 10:19 PM 0
Share

Everytime you create an object (not necessarily a GameObject, can be anything) it uses some memory. When you're not using anymore (cause you destroyed it or no variable is referencing it) it will me marked to be collected. From time to time (you have no control over it) the Garbage Collector will remove from the memory everything that is marked. If it have too much to remove it can cause the FPS drops that you see.

avatar image shaderop · Sep 26, 2012 at 10:51 PM 0
Share

@Cool Dave: Profiler is a a pro-only feature, but I thought you had Pro because of the dark background in the picture you posted. $$anonymous$$y mistake :)

Show more comments
avatar image
1

Answer by Owen-Reynolds · Sep 27, 2012 at 03:51 AM

The Unity Editor sometimes, very intermittently, get pauses and stutters during a run, just for being the Editor. It's keeping extra stats, running the Inspector and Hierachy windows ... . I've run the exact same stuttering projects in a real Build and had it all go away (then come back in the Editor again.)

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

Answer by Bunny83 · Sep 27, 2012 at 12:43 PM

The worst thing you can do is to have a Debug.Log (or print) statement in Update. It will kill your framerate. Are you sure you don't spam Debug.Logs? In a build Debug.Logs in Update aren't that bad, but keep in mind they get written to the log file. When one log has about 500 bytes and you run at 60 fps, that's a lot per minute (~1.5MB / min) ;)

I know some games that create huge logs when you play for a while. In my opinion that's not an acceptable behaviour ;)

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

11 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

Related Questions

GPU Graphics.blit huge time on android 0 Answers

Game skips at specific points in level (not garbage collector) 0 Answers

Huge permorance difference - Help?! 0 Answers

Performance/framerate issue 0 Answers

Low fps with only a few characters? 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