<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Finalizers on Nalar</title>
    <link>https://nalar.dev/tags/finalizers/</link>
    <description>Recent content in Finalizers on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 16 Sep 2026 00:00:00 +0700</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/finalizers/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Go Runtime Finalizers Delay Object Reclamation</title>
      <link>https://nalar.dev/go-runtime-finalizers-delay-object-reclamation/</link>
      <pubDate>Wed, 16 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/go-runtime-finalizers-delay-object-reclamation/</guid>
      <description>&lt;p&gt;A Go object with a finalizer is not reclaimed when the garbage collector first determines that it is unreachable. The runtime must retain the object for the finalizer call, and reclamation can occur only after a later collection finds the object unreachable again.&lt;/p&gt;&#xA;&lt;p&gt;That behavior makes &lt;code&gt;runtime.SetFinalizer&lt;/code&gt; materially different from ordinary garbage collection. It adds an asynchronous lifecycle phase between loss of application reachability and memory reclamation.&lt;/p&gt;&#xA;&lt;h2 id=&#34;finalization-temporarily-restores-reachability&#34;&gt;Finalization temporarily restores reachability&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;runtime.SetFinalizer(obj, f)&lt;/code&gt; associates &lt;code&gt;f&lt;/code&gt; with &lt;code&gt;obj&lt;/code&gt;. When the collector detects an unreachable object with that association, it clears the association and arranges a call to &lt;code&gt;f(obj)&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
