is there a way to see GC? [Solved]

Get help using Construct 2

Post » Sat Oct 25, 2014 5:45 am

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..!
Last edited by jobel on Tue Oct 28, 2014 3:55 pm, edited 2 times in total.
B
88
S
29
G
14
Posts: 1,154
Reputation: 15,003

Post » Sat Oct 25, 2014 10:09 am

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.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,828

Post » Sun Oct 26, 2014 4:15 am

@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...
Last edited by jobel on Sun Oct 26, 2014 3:28 pm, edited 1 time in total.
B
88
S
29
G
14
Posts: 1,154
Reputation: 15,003

Post » Sun Oct 26, 2014 5:41 am

jobel wrote: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.
B
56
S
15
G
13
Posts: 825
Reputation: 17,643

Post » Sun Oct 26, 2014 3:27 pm

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?
B
88
S
29
G
14
Posts: 1,154
Reputation: 15,003

Post » Sun Oct 26, 2014 5:37 pm

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.
You do not have the required permissions to view the files attached to this post.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,620

Post » Tue Oct 28, 2014 12:39 am

this is very cool @ramones I'm looking into this now... thank you!
B
88
S
29
G
14
Posts: 1,154
Reputation: 15,003


Return to How do I....?

Who is online

Users browsing this forum: Darth Crusher and 4 guests