<div dir="ltr">Did you try a SpaceTally to know at least,  instances of which class are the ones taking most of the space? </div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 31, 2015 at 5:29 PM, Phil (list) <span dir="ltr">&lt;<a href="mailto:pbpublist@gmail.com" target="_blank">pbpublist@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On Thu, 2015-12-31 at 08:14 -0800, KenD wrote:<br>
<span class="">&gt;  <br>
&gt; On Thu, 31 Dec 2015 03:36:46 -0500<br>
&gt; &quot;Phil (list)&quot; &lt;<a href="mailto:pbpublist@gmail.com">pbpublist@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; I was curious if the VM has any facilities to assist in tracking<br>
&gt; &gt; down<br>
&gt; &gt; memory leaks? (not in the VM itself, but rather in the image it is<br>
&gt; &gt; running)  The scenario that comes to mind are object reference<br>
&gt; &gt; loops<br>
&gt; &gt; though there are likely others to consider as well.  Any pointers<br>
&gt; &gt; are<br>
&gt; &gt; appreciated.<br>
&gt;<br>
</span>&gt; Hi Phil,<br>
&gt;<br>
&gt; It depends on what, specifically, you are doing.<br>
&gt;<br>
&gt; There are tools in Caregory Tools-ReferenceFinder which I suspect<br>
&gt; would be of help.<br>
&gt;<br>
<br>
I&#39;ve been using reference finder and weight explorer to do some<br>
preliminary investigation but given the current size of this image<br>
(250M) it&#39;s slow going with each search taking upwards of a minute and<br>
running into OOM problems.  But if that&#39;s all there is, I&#39;ll keep going<br>
down this path.<br>
 <br>
&gt; In the limit, any deep memory bug is probably investigated in a VM<br>
&gt; simulator.  This type of bug in a released image is rare.  Typical<br>
&gt; images do not load the object-memory/vm simulator, but you can build<br>
&gt; a VMMaker image which has the code.<br>
&gt;<br>
<br>
At this stage I&#39;m expecting to find that it&#39;s my code doing the leaking<br>
into the image, and not a base image or VM bug.  My original thought<br>
was that I had some orphaned reference loops floating around but ran<br>
across a post that indicated that unrooted reference loops should not<br>
be a problem for the VM to gc.  I&#39;ve done all of the obvious things I<br>
could think of to minimize rooted references including closing<br>
workspaces, browsers, inspectors, terminated Smalltalk processes etc.<br>
 Any ideas as to what other possible ways these objects could be<br>
rooted?<br>
<br>
&gt; Note that this is for people with deep knowledge.  You have to<br>
&gt; understand how objects are represented in memory, Cog (JIT) vs non-<br>
&gt; Cog, Spur vs non-Spur,  StackInterpreter vs optimized, ...<br>
&gt;<br>
<br>
Hoping not to need to dive this deeply just yet.  (esp. for what<br>
appears to be a user-space problem)<br>
<br>
&gt; Two article blogs discuss the deeper currents within the VM:<br>
&gt;  <a href="http://www.mirandabanda.org/cogblog/" rel="noreferrer" target="_blank">http://www.mirandabanda.org/cogblog/</a><br>
&gt;  <a href="https://clementbera.wordpress.com/author/clementbera/" rel="noreferrer" target="_blank">https://clementbera.wordpress.com/author/clementbera/</a><br>
&gt;<br>
&gt; Note that because of the Squeak/Pharo/Cuis community, you can safely<br>
&gt; ignore the VM and play happily in Smalltalk, so don&#39;t feel you have<br>
&gt; to dive into this level of operations unless you have the calling for<br>
&gt; it (i.e. you are walking alone and something reaches out from the<br>
&gt; earth, grabs your ankle, and down you go.  Hey, it happens!).<br>
&gt;<br>
<br>
I didn&#39;t start down this path out of curiosity ;-)  You can only ignore<br>
it when it doesn&#39;t result in your image growing by an order of<br>
magnitude larger than it should be and beginning to experience<br>
performance issues as a result.  I could start from a new base image<br>
but as this is code I want to productionize at some point, I&#39;d expect<br>
that whatever is going on right now will be a problem down the road so<br>
I&#39;d rather deal with it sooner rather than later.<br>
<br>
&gt; Cheers,<br>
&gt; -KenD<br>
<span class="HOEnZb"><font color="#888888"><br>
Phil<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br></div>
</div>