You need to sign in or sign up before continuing.
Improve the algorithm used for determining if we should collect garbage
Right now the algorithm used for determining if we need to collect garbage is pretty simple: if we have allocated more than N blocks, we collect. Once collection is done we increase the threshold by factor Y.
While simple this comes with a downside: the more garbage collections, the greater the threshold. The greater the threshold, the more blocks we may need to allocate in case of some kind of loop. This can ultimately lead to memory increasing faster than the garbage collector can keep up with.