Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delay garbage collection?

I'm using chrome (the dev version for my mac).

I was looking at the timeline for my page loading and I saw that there is a 150ms delay due to some garbage collection taking place while loading the page.

loading times

It's the yellow line.

I was curious if there's any way to stop this, delay it, whatever so I get the page to load faster?

like image 466
GeoffreyF67 Avatar asked Nov 26 '22 19:11

GeoffreyF67


1 Answers

Against the grain of some of the comments, this isn't a C++ issue.

Garbage Collection happens when v8 (the javascript engine in chrome) engine detects that it should start freeing up memory used by objects that are no longer needed in the code. You can visit the v8 page for more information about what the garbage collector does.

There might be lots of reasons why your code is garbage collecting early, and in that case we would need to see your code. Do you have a lot of variables that go out of scope at page load?

like image 198
Kinlan Avatar answered Jan 13 '23 03:01

Kinlan