Deterministic destruction RAII style is handled in GCd languages with try-with-resources or using type constructs.<p>Modern collectors like G1 don&#x27;t do full mark&#x2F;sweeps of the entire heap in normal operation - only in rare cases like if you request a memory profile, or if the entire process runs out of RAM and needs to do a hard stop. And reference counting isn&#x27;t something you can just automatically do due to the presence of cycles.<p>Notwithstanding these things, you may be interested in Graal, and specifically this talk on automatic region allocation:<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=3JphI1Z0MTk&amp;list=PLX8CzqL3ArzUo2dtMurvpUTAaujPMeuuU&amp;index=12" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=3JphI1Z0MTk&amp;list=PLX8CzqL3Ar...</a><p><a href="http:&#x2F;&#x2F;www.oracle.com&#x2F;technetwork&#x2F;java&#x2F;jvmls2015-wimmer-2637907.pdf" rel="nofollow">http:&#x2F;&#x2F;www.oracle.com&#x2F;technetwork&#x2F;java&#x2F;jvmls2015-wimmer-2637...</a>