<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"><<a href="mailto:pbpublist@gmail.com" target="_blank">pbpublist@gmail.com</a>></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="">> <br>
> On Thu, 31 Dec 2015 03:36:46 -0500<br>
> "Phil (list)" <<a href="mailto:pbpublist@gmail.com">pbpublist@gmail.com</a>> wrote:<br>
><br>
> > I was curious if the VM has any facilities to assist in tracking<br>
> > down<br>
> > memory leaks? (not in the VM itself, but rather in the image it is<br>
> > running) The scenario that comes to mind are object reference<br>
> > loops<br>
> > though there are likely others to consider as well. Any pointers<br>
> > are<br>
> > appreciated.<br>
><br>
</span>> Hi Phil,<br>
><br>
> It depends on what, specifically, you are doing.<br>
><br>
> There are tools in Caregory Tools-ReferenceFinder which I suspect<br>
> would be of help.<br>
><br>
<br>
I'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's slow going with each search taking upwards of a minute and<br>
running into OOM problems. But if that's all there is, I'll keep going<br>
down this path.<br>
<br>
> In the limit, any deep memory bug is probably investigated in a VM<br>
> simulator. This type of bug in a released image is rare. Typical<br>
> images do not load the object-memory/vm simulator, but you can build<br>
> a VMMaker image which has the code.<br>
><br>
<br>
At this stage I'm expecting to find that it'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'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>
> Note that this is for people with deep knowledge. You have to<br>
> understand how objects are represented in memory, Cog (JIT) vs non-<br>
> Cog, Spur vs non-Spur, StackInterpreter vs optimized, ...<br>
><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>
> Two article blogs discuss the deeper currents within the VM:<br>
> <a href="http://www.mirandabanda.org/cogblog/" rel="noreferrer" target="_blank">http://www.mirandabanda.org/cogblog/</a><br>
> <a href="https://clementbera.wordpress.com/author/clementbera/" rel="noreferrer" target="_blank">https://clementbera.wordpress.com/author/clementbera/</a><br>
><br>
> Note that because of the Squeak/Pharo/Cuis community, you can safely<br>
> ignore the VM and play happily in Smalltalk, so don't feel you have<br>
> to dive into this level of operations unless you have the calling for<br>
> it (i.e. you are walking alone and something reaches out from the<br>
> earth, grabs your ankle, and down you go. Hey, it happens!).<br>
><br>
<br>
I didn't start down this path out of curiosity ;-) You can only ignore<br>
it when it doesn'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'd expect<br>
that whatever is going on right now will be a problem down the road so<br>
I'd rather deal with it sooner rather than later.<br>
<br>
> Cheers,<br>
> -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>