is there a way to see GC? [Solved]

0 favourites
  • 7 posts
From the Asset Store
Solve the mathematical equations as fast as you can!
  • hi,

    is there a way to know how much "garbage" you are making the system cleanup? I looked in the debugger but didn't see anything related to "garbage-collection".

    Sometimes when I even create small games I get the gc "pauses" when the game doesn't have much going on at all...

    Does having many Chrome tab opens at the same time add to the problem? I'd love to see in a game I am working on how much GC is happening (i.e. slowing down the game).

    thanks..!

  • Just wondering how do you know its GC "Pauses" and not something else? Are there anything about the way these lags behave that makes you think its this.

  • nimos100 that's exactly what I am trying to find out. And since GC is a documented issue I want to know if that's causing me issues or if it's just inefficient code/design.

    I suspect GC in a number of cases because I can have 60FPS and hardly any cpu usage, but still get pauses happening as a sprite just floats around the screen. and it happens rhythmically.... like smooth for a second or 2, then stutter, stutter and again, the exact same issue...

  • that's exactly what I am trying to find out. And since GC is a documented issue I want to know if that's causing me issues or if it's just inefficient code/design.

    I suspect GC in a number of cases because I can have 60FPS and hardly any cpu usage, but still get pauses happening as a sprite just floats around the screen. and it happens rhythmically.... like smooth for a second or 2, then stutter, stutter and again, the exact same issue...

    Oh the joys of HTML5 gaming.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • yeah I think somehow I'd feel better if in the debugger I could see a GarbageCollection percentage.. and if it spiked rhythmically then I'd know.. "oh somehow I am doing something to cause more GC...let me try to rework some things".. I mean of course I am already doing that, but I'm in the dark.. I'd like to know for sure it was GC..

    so there's no way to tell?

  • Have a look at the Timeline panel in Chrome DevTools.

    Here's a snapshot from running SpaceBlaster filtered to show the garbage collection events. The blue line in the graph below shows the memory usage over time. There's a garbage collection every 3-4 seconds. If you zoom right in on the timeline you can see how long each frame takes and all the (js) events that run during that frame. The garbage collection events here take less than a millisecond each and don't affect the framerate at all.

  • this is very cool ramones I'm looking into this now... thank you!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)