First, let's take a look at the interest of a group of friends who are also from. gameframework! Recently, the project has been too busy. Although it is not an absolutely important role in the project, it is still necessary for me to do a complicated job.
The memory allocation mechanism leads to the generation of garbage collection. In fact, GC mainly solves the problem.
Dynamic Allocation: dynamically allocates memory space in the heap to store data. The memory block in the heap is like the napkin we use everyday. If we use it, we have to drop it into the garbage bin. Otherwise, the house will be full of space. A lazy like me dream of having a home robot to clean the house with him. In software development, if you are too reluctant to release the memory, you also need a similar robot-this is actually a specificAlgorithmImplementation of the garbage collector.
Therefore, the garbage collection technology we generally mention is to recycle the memory dynamically allocated to the heap!
Several Typical garbage collection algorithms in history are used in several garbage collection algorithms.
Today, the research areas of garbage collection include
Garbage collection in Distributed Systems, garbage collection in complex transaction environments, and garbage collection in specific systems such as databases.
AboveArticleI strongly recommend that you refer to the articles from Wang Yonggang. For more information about the algorithm, see Yonggang's article on the metaphor of "Napkin". It's amazing!