<i>A good one can detect that only a range of allocation is alive and release unused part of someLargeString.</i><p>Can you give an example of a (somewhat widely-used) library&#x2F;runtime that does this?<p>I think this is harder than it initially seems. How does the GC know that if you have some type with a backing array and two pointers (or indices) that I don&#x27;t want to move one of the pointers to some other valid position later?<p>I am not arguing that it is not possible, but this seems difficult in the general case, unless you can explicitly provide hints to the garbage collector.