“This is the 25th day of my participation in the August Gwen Challenge.

🔉 introduction

Finished the classic garbage collector, then talk about low latency of the garbage collector, although not exposed at ordinary times, but not say what time to learn what time use, but to have a first, because a lot of things not learn GanTang, now also is not now in use, will slowly but surely, one step at a time, walk every step well ⛳, my article is not for an interview, Not in fancy language packaging, just say what IT is in my eyes, if you are interested, then with me to see 👀.

🌁 Shenandoah collector

🌀 Shenandoah loneliness

Our social competition is fierce, genius will inevitably be excluded, not to mention the garbage collector world, Shenandoah collector is the first not by the original company led by the development of HotSpot garbage collector, inevitably excluded, after all, is not biological, prefer a little less natural, less to what extent? This means that you can only see it in OpenJDK, the commercial OracleJDK completely excludes it.

Who’s the company that’s related? RedHat, of course. What, haven’t you heard of it? No, just kidding. Red Hat’s goal is to make this collector so that it can limit the pause time of garbage collection to 10MS under any heap size. Wow, awesome. What does that mean? The Shenandoah collector says, “I’m also going to do concurrent garbage cleanup.”

🌀 successor to G1

The Shenandoah collector is more likely to be the next generation successor to G1 than the more pureblood ZGC. The two collectors have many similarities and even share some of the source code. Although the Shenandoah collector also has the memory layout of regions, as well as the Humongous Region for storing large objects, But the Shenandoah collector is a bit of an improvement over the G1, otherwise it’s hard to keep the G1 on the beach.

That’s different from the G1 in at least three ways:

  • Supports concurrent collation algorithms
  • By default, generational collection is not used
  • Use the connection matrix (Connection Matrix)Replaces the memory set

Concurrent arrangement is the treasure of the town. As we will talk later, generation is not realized. It is not to say that generation is not important, but for the trade-off of cost performance, it is put in a lower priority. The Shenandoah collector eliminates the memory set and uses a connection matrix to record cross-generation Region references, reducing resource consumption for handling cross-generation reference Pointers and reducing the problem of pseudo-sharing (portal).

What the hell is a connection matrix? Don’t worry, we are a little bit, a bit of a mathematical foundation of the people know that the matrix is two-dimensional, is a M and N columns, that if you have pointed to the RegionN RegionM object, then M line in the two-dimensional table N make a mark in the column, as shown in figure.

So we see that M of RegionM is 5 and N of RegionN is 3, so we put a cross in 5 rows and 3 columns. This record tells us which regions have cross-generation references.

📝 digression

Among primitive men, it was chiefly fear that roused the idea of religion. These include fear of hunger, fear of wild animals, fear of disease, and fear of death. Since the understanding of cause and effect is usually very low in this stage of existence, people create illusions in their minds that are more or less like themselves, and think that the occurrence of the things they fear depends on the will and action of these illusions.

Therefore, people try to entertain these illusory creatures, pacify them or make them feel good about humans through rituals passed down from generation to generation. In this sense, I call it a furcht-religion. Although these religions were not created by any one person, a particular priestly class had been formed and thus had considerable stability. The priesthood established its supremacy by acting as mediators of communication between the things people feared. In general, chiefs, rulers, or privileged classes who came to power by other means consolidated their temporal power by combining it with the functions of the priesthood. Or the rulers and priesthood of political power were allied with each other for their own benefit.

So the essence of power is still based on snooping into human nature.