[squeak-dev] A couple of memory management related questions
yoshiki at vpri.org
Tue Jun 15 22:08:35 UTC 2010
At Tue, 15 Jun 2010 16:44:57 -0500,
Ralph Johnson wrote:
> If people define classes by hand, I imagine 64k would be enough. But
> suppose they are using light-weight classes, i.e. giving each object
> its own behavior. Then it would be fairly easy to have more than 64K
> of them, though 1M is still a reasonable limit.
> What is the difference in cost between choosing 64K as the limit and
> choosing 1M? I know, one byte, but what else would you use that byte
If the next highest notch from 16 bit is 24 bit but not 20 bit, that
would be 16M but not 1M.
The big images in "our" use cases is with several million objects
(not that big in other standard), so if each object theoretically had
a distinct class, it would only barely fits. But in reality 16M
classes and an object occupies around 40 byte each on avarage, only 6
instances or such per class on average before hitting 4GB. So, for
32-bit address space in mind, 16M classes would be a lot. 1M classes
would be 100 instances on average (where the distribution of instance
count is highly skewed so average would not make so much sense
however), it still would be okay.
(As Ralph asked, what are the other things that are competing the
More information about the Squeak-dev