[Vm-dev] normalSend, specialObjectsArray and VM

Bert Freudenberg bert at freudenbergs.de
Sun Oct 3 14:19:02 UTC 2010


On 03.10.2010, at 13:32, Mariano Martinez Peck wrote:

> 
> 
> On Sun, Oct 3, 2010 at 1:03 PM, Bert Freudenberg <bert at freudenbergs.de> wrote:
>  
> On 03.10.2010, at 12:45, Mariano Martinez Peck wrote:
> 
>> On Sun, Oct 3, 2010 at 12:42 PM, Bert Freudenberg <bert at freudenbergs.de> wrote:
>>  
>> What exactly are you trying to do?
>> 
>> hehehe sorry. I am trying to "detect unused objects".
> 
> What for?
> 
> 
> 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.
> 
> If you are interested, you may want to see the slides of my ESUG talk:  http://www.slideshare.net/esug/swapping-esug2010
> (the video is not yet available)
> 
> 
>  
>>  When do you consider an object to be "used"? 
>> 
>> 
>> When it receives a message. This is why I changed #normalSend
>> 
>> Thanks in advance,
>> 
>> Mariano
> 
> 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.
> 
> 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. 
>  
> 
> Judging from your test cases, if an objects is just passed as an argument, you do not consider it to be used.
> 
> 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. 
> Now...what happens if you pass an object by argument and you don't send any message?  I guess it should be marked.
> 
> 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 -> overhead.
>  
> What if you send it the #class message? What if you identity-compare it (==)?  Should that count as "used"?
> 
> 
> Good question. I would guess that yes. Is there a way to know all these "anormal" sends?  I know #class is in bytecode, etc. But I don't know all of them.
>  
> Maybe if you let us in on the bigger picture we could help you better.
> 
> 
> Thanks Bert. Please let me know if there is something missing. 
> 
> Mariano 

Well, that explanation helped. 

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.

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 ;)

- Bert -


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20101003/37fd2c02/attachment.htm


More information about the Vm-dev mailing list