<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 03.10.2010, at 13:32, Mariano Martinez Peck wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><br><div class="gmail_quote">On Sun, Oct 3, 2010 at 1:03 PM, Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
&nbsp;<br><div style="word-wrap: break-word;"><div><div>On 03.10.2010, at 12:45, Mariano Martinez Peck wrote:</div><br><blockquote type="cite">On Sun, Oct 3, 2010 at 12:42 PM, Bert Freudenberg <span dir="ltr">&lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt;</span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
&nbsp;<br><div style="word-wrap: break-word;"><div>What exactly are you trying to do?</div></div></blockquote><div><br>hehehe sorry. I am trying to "detect unused objects".<br></div></div></blockquote><div><br></div>
<div>What for?</div><br></div></div></blockquote><div><br>Hi Bert. The idea is to be able to detect objects that are not used but referenced (this is why the GC don't collect them). We think there are a lots and lost of objects in this situation: they are referenced but not used for a long time, only agains certain situations, etc. The idea is to detect subgraphs of unused objects and swap them to disk, and let proxies in the image that know how to load back them when necessary.<br>
<br>If you are interested, you may want to see the slides of my ESUG talk:&nbsp; <a href="http://www.slideshare.net/esug/swapping-esug2010">http://www.slideshare.net/esug/swapping-esug2010</a><br>(the video is not yet available)<br>
<br><br>&nbsp;</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;"><div><blockquote type="cite"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div style="word-wrap: break-word;"><div>&nbsp;When do you consider an object to be "used"?&nbsp;</div><div><br></div></div></blockquote><div><br>When it receives a message. This is why I changed #normalSend<br><br>Thanks in advance,<br>

<br>Mariano<br></div></div></blockquote><div><br></div><div>Neither the class nor the compiled method "receive a message". Plus there are many ways an object "appears" to receive a message but isn't really. E.g. a Float won't receive #+ because that is short-circuited in the bytecodes. A super send does not use "normalSend". Etc.</div>
</div></div></blockquote><div><br>Yes, that's one of my problems. I am interested in knowing all these "anormal" situations. And yes, I think the definition "an object is usage when it receives a message" is not clear enough. Because yes, I would like to mark the CompiledMethod, Float when sending #+, and super calls. <br>
&nbsp;</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;"><div><div><br></div><div>Judging from your test cases, if an objects is just passed as an argument, you do not consider it to be used. </div>
</div></div></blockquote><div><br>Good question. If you pass an object as parameter, you will probably send a message to it. In such case, then yes, it will be marked. <br>Now...what happens if you pass an object by argument and you don't send any message?&nbsp; I guess it should be marked.<br>
<br>Anyway the mark has not to be THAT strict. I mean, I would like to be like that. But all these step of detecting unused objects is because I will try to swap them. Thus, the less they are usually used, the best. In the worst case, I will swap an object and will be used inmediatly -&gt; overhead.<br>
&nbsp;</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;"><div><div>What if you send it the #class message? What if you identity-compare it (==)? &nbsp;Should that count as "used"?</div>
<div><br></div></div></div></blockquote><div><br>Good question. I would guess that yes. Is there a way to know all these "anormal" sends?&nbsp; I know #class is in bytecode, etc. But I don't know all of them.<br>
&nbsp;</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div style="word-wrap: break-word;"><div><div></div><div>Maybe if you let us in on the bigger picture we could help you better.</div>
<div><br></div></div></div></blockquote><div><br>Thanks Bert. Please let me know if there is something missing. <br><br>Mariano&nbsp;</div></div></blockquote><br></div><div>Well, that explanation helped.&nbsp;</div><div><br></div><div>IMHO, sends are too high-level to give accurate "usage" information. You might have to do it in the fetch/store functions (or even the memory access macros), which probably would have a serious performance impact.</div><div><br></div><div>You could still try to do it in the sends and primitives and byte codes, if you then propagate usage info to related objects. You're only interested in finding larger image subgraphs that are unused anyway, so this might be okay. You'll find out pretty promptly if you swapped out something that was still needed ;)</div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Grande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">- Bert -</span></div><br class="Apple-interchange-newline"></span>
</div>
<br></body></html>