<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 10/26/2017 06:03 PM, Boshan Sun
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAMbuPGxHDGCQejZu60FRP2Yh4JVY81+qQbPEZt-vxH03w=Z4_g@mail.gmail.com">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div dir="ltr"><span style="font-size:14px">Does those literals
lives in the constant heap has a ref counter, as the refc
binary? If not, how do they get garbage collected? If so, will
those constant suffers same "memory leak" issue has refc
binary?(a process touched lots of refc binary but never get
garbaged collected, so those refc binaries cannot be garbage
collected for a long time)</span>
<div style="font-size:14px"><br>
</div>
</div>
</blockquote>
<br>
No, literals are not ref counted.<br>
<br>
All literals belong to a loaded module instance. When that (old)
module instance is purged, all process heaps are scanned and heaps
containing those literals will do a special garbage collection where
the literals are copied.<br>
<br>
<br>
/Sverker<br>
</body>
</html>