How to solve the problem of cyclic invocation by train algorithm

Let"s not talk about the principle of the train algorithm here.
the train algorithm is the gc algorithm used by the G1 collector

clipboard.png

D _ C are three objects that need to be called to each other. There are no other citations. But when the algorithm scans the first block of memory, D has a reference to E, E has a reference to c, and c has a reference to D. Both D and E will remain. On the second scan, C also has a reference to D and is preserved. Isn"t it true that the garbage has not been recycled at all

Mar.14,2021

what train algorithm noun does not quite understand, in my opinion, this is a circular reference problem. In some garbage collection algorithms, circular references do cause memory leaks.


you can refer to Progressive garbage Collection: train algorithm

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37f52-2c0e1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37f52-2c0e1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?