[Vm-dev] Question about memory allocation in VM

Mariano Martinez Peck marianopeck at gmail.com
Tue May 4 13:12:48 UTC 2010


Sorry in advance if this was asked before...I have something in my mind that
says it was :(

I want to know how the memory is allocated between the VM and the OS. For
example, I know (actually, I think I know) that in Mac OS VM when you run an
image, the VM allocates (malloc() I guess) the same size at least, of the
image. So...I couple of questions:

1) Is the same behavior for all OS ? If not, which happens with the rest?

2) Where is such behavior defined? I don't think it is in VMMaker but in the
C support code of each VM. But where (.c and function anme) , any quotes?

3) In am working (actually yet thinking) a mechanism that will probably use
much less memory than the image. The idea is to swap to disk unused objects.
Then....the amount of memory I will use should be MUCH smaller than the size
of the image. So my question is, which changes should I do to the VM so that
it uses only THAT amount of memory and not the size of the image.

As I said, suppose I have an image size (in disk) on 15MB. Suppose I run
that image, and then, as I swapped a lot of objects to disk, the actual
usage of memory is 3 MBs. So what I want is that OS only uses 3 MB and not
15. Can I do that ?

Thanks a lot for answering to this newbie :)

Mariano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20100504/972a478a/attachment.htm


More information about the Vm-dev mailing list