[Tutor] lists, name semantics

Dave Angel davea at davea.name
Mon Apr 20 01:19:27 CEST 2015


On 04/19/2015 06:28 PM, Joel Goldstick wrote:
> On Sun, Apr 19, 2015 at 6:23 PM, boB Stepp <robertvstepp at gmail.com> wrote:
>> On Sun, Apr 19, 2015 at 4:05 PM, Dave Angel <davea at davea.name> wrote:
>>> On 04/19/2015 03:08 PM, boB Stepp wrote:
>>>>
>>
>>>> Or is the real point that we are adding an abstraction
>>>> layer so we don't even have to think about where objects are
>>>> physically stored in RAM?
>>>
>>>
>>> Somebody keeps track, but the address is not necessarily constant, and not
>>> necessarily stored in any references.  The references (bindings) are
>>> abstract, and the details are unimportant to the user.  For example, the
>>> jython system does not use addresses at all.  And an object gets moved
>>> around from time to time without its references knowing it.
>>
>> The last sentence in this paragraph has me intrigued. Why would an
>> object, once it has been created, be moved? What practical benefit
>> does doing this give?
>>
>> boB
>
> I'm guessing memory management.  You want to have large contiguous
> blocks of memory available for large objects.  If a small object is
> surrounded by available memory, you might want to move it to some
> smaller empty spot.

Good answer.  The java jvm garbage collector is free to move blocks 
around to defrag the free space.

FWIW, I'm told the ID value used is a simple integer, that indexes a 
list containing the actual addresses.

So in this case, the binding value is an integer, not an address.

-- 
DaveA


More information about the Tutor mailing list