Prim error returns (was Re: [squeak-dev] The Primitive: I am not a number- I am a named prim! - SqueakPeople article)

John M McIntosh johnmci at smalltalkconsulting.com
Wed Jul 2 16:07:27 UTC 2008


On Jul 2, 2008, at 7:06 AM, Eliot Miranda wrote:

> Something that *could* be in the VM is accounting of how much space  
> a process consumes.  Add a slot to each process known to the VM  
> called e.g. slotsAllocated.  The VM computes the slots allocated  
> between context switches.  This is cheap to compute because it can  
> compute how much space was allocated since the last garbage  
> collection or process switch simply by subtracting the allocation  
> pointer at the end of the previous GC or process switch from the  
> current allocation pointer.  The slots allocated since the last  
> process switch is added to the slot in the old process and the slots  
> allocated count zeroed on each context switch.  We then have an  
> accurate measure of how much space each process has allocated.

Ya, there is exactly one place in the VM where the processor switch  
happens. In the past I tinkered with it to add some slots to Process  
to track wall clock time by process.
At that time was I was thinking gee we could count bytes allocated and  
other things like socket usage etc, thus providing a bit more process  
consumption statistical data for
Squeak threads ala unix processes.

--
= 
= 
= 
========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com>
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
= 
= 
= 
========================================================================





More information about the Squeak-dev mailing list