0

I learned that the garbage collection is performed to some data which are not assumed to be used anymore (not referenced).

However, how often does the machine determine whether the data is to be cleaned?

Is there a fixed period? Or the GC runs when cpu is idle? Or any other way?

mplungjan
  • 169,008
  • 28
  • 173
  • 236
Jiseop Han
  • 37
  • 7
  • Not sure when but from what I remember, when a variable is not referred by any part of code, its up for nuke. Useful read: https://stackoverflow.com/questions/864516/what-is-javascript-garbage-collection – Rajesh Jan 27 '20 at 07:14
  • i know some gc algorithms such as mark and sweep. My question is how often does 'sweep' occurs and when does machine 'sweeps' – Jiseop Han Jan 27 '20 at 07:18

0 Answers0