Clase 8 - “A New Age of JVM Garbage Collectors”
“A New Age of JVM Garbage Collectors”
In this exposition, the presenter
talks first about why a garbage collector is necessary for any programing
language. And to be honest for any programmer understanding this is quite basic
and can be resumed to 2 phrases. All programs generate united use of memory and
memory is a finite resource. So for these 2 simple reasons we need a garbage
collector.
Now to get into the juicy part
of the presentation we are going to analyze the different types of garbage
collectors that are presented. The first and more basic one is manual memory management;
it is hard to even consider this a garbage collector as it is done by the user.
It is mostly used in the C language and works with a pointer to allocate and
deallocate memory.
Getting now into more
interesting garbage collectors, the next model is Automatic reference counting.
This model is based on keeping track of how many times an object is referenced.
As long as there is one reference the allocation has to be there, but as soon
as the count is 0 it can deallocate that memory. It is considered a good
garbage collector but still has some problems as fragmentation and Pitfalls.
Now let us consider some higher-level
garbage collectors, we have Mark sweep compact GC; this is famously used by Java.
It is based on tracking all live objects in the program and then deleting everything
else. Different from the past garbage collectors we analyzed this mode dose
compact the remaining memory to prevent fragmentation. This model can also be
complemented with Evacuating GC which uses heaps of the same size to do the
compaction.
If I had to have a conclusion
about this talk is that garbage collectors are way more complex than I would
have initially thought. They are all composed of several new and old ideas with
hundreds of trade-offs along the way. After this talk, the only thing I am certain of is that I am extremely grateful the garbage collectors exist.
Comentarios
Publicar un comentario