3 ms·
Web servers handling lots of small requests are actually pretty easy to garbage collect to: you just delete all the data at the end of the request. Either you
by eru 2y ago
Web servers handling lots of small requests are actually pretty easy to garbage collect to: you just delete all the data at the end of the request.
Either you have a specialised GC that works like this, or probably a good general generational GC can pick up on this pattern on its own.
- jlouis 2y agoOr you do as Erlang's BEAM VM: each thread has it's own memory area which is GC'ed individually. This means upon request termination, you just terminate the thread and the memory is reclaimed with no need for a GC.
- eru 2y agoIn the abstract, this is very similar to spawning a unix process for every request, never free-ing any memory, and letting the memory allocation die with the process.