1

I have a game that has lag after some time but when I profile it in Chrome as (Tree - top down) has (Totals):

  • ~89%: (idle) - I don't know what is it.
  • ~ 3%: (program) - I think is the interface of my app, chrome and with the OS;
  • 1.2%: (garbage collector)
  • 6.6%: game loop function

The frame rate is around 8-10 and it gets down to 0 fps. The CPU also is around 50% used.

My question is what is going on? I think idle means that is "free time" for cpu, but I'm wrong.

Can anyone explain to me what exactly is idle, as in google doesnt specify it in their docs (https://developers.google.com/search/results?q=idle&p=%2Fchrome-developer-tools)?

Also memory consumption might be a problem, in this case my game is leaking.

Totty.js
  • 15,563
  • 31
  • 103
  • 175
  • Idle means exactly what you think it means. – a better oliver Dec 28 '13 at 18:02
  • then why my frame rate is so low when idle is 88%? that's not logical at all... – Totty.js Dec 28 '13 at 18:07
  • Frame rate is not all about CPU usage. There is too little information about your app to give a qualified answer. – a better oliver Dec 28 '13 at 18:16
  • then what should I look at? – Totty.js Dec 28 '13 at 18:21
  • You mentioned a potential memory problem. When the garbage collector runs then everything stops, so you want to reuse as much as possible and avoid leaks. 1.2% for the garbage collector is not low. Also: what technology do you use? SVG, Canvas, pure HTML or WebGL? Do you use a framework or library or did you wrote all game and rendering code yourself? – a better oliver Dec 28 '13 at 18:32
  • I'm using PIXI which uses WebGl. The leaking problem is in Box2D somehow, I've also asked a question about it: http://stackoverflow.com/questions/20817760/how-to-properly-delete-a-box2d-body-in-version-box2dweb-2-1-a-3-js but didn't found an answer yet – Totty.js Dec 28 '13 at 18:38
  • Maybe [this article](http://www.html5rocks.com/en/tutorials/games/abouttracing/) can help you finding the performance bottleneck of your app. – a better oliver Dec 28 '13 at 18:56
  • that is being useful. I've noticed that is not even using the GPU, if I understand correctly – Totty.js Dec 28 '13 at 19:50
  • Would you mind posting a screenshot? Maybe someone has an idea. – a better oliver Dec 28 '13 at 21:02
  • well, this is a memory leak problem: http://stackoverflow.com/questions/20817760/how-to-properly-delete-a-box2d-body-in-version-box2dweb-2-1-a-3-box2d-v2-3-1r3 – Totty.js Dec 30 '13 at 13:15

0 Answers0