On May 13, 5:11pm, Jack Scheible wrote:
> Subject: Re: Fragmentation; was Re: memory leak
> you seem to be confusing address space, which is the amount of memory
> that CAN BE ADDRESSED (4G for each process on a 32-bit machine),
The above is the definition of virtual memory; the virtual address
space of a process is the subset of this address range that the
process has allocated to it (whether or not the allocation is backed
by physical resources).
> ...not
> the amount of memory that EXISTS, with virtual memory, which is, for
> all practical purposes, the amount of memory that actually exists.
I see the problem. You have the definition of virtual memory wrong.
Virtual memory is strictly a software concept, and has nothing to
do with physical memory, which generally consists of RAM + swap.
To quote from Tanenbaum, "Modern Operating Systems":
The basic idea behind virtual memory is that the
combined size of the program, data and stack may exceed
the amount of physical memory available for it.
Addresses that pointers, etc., have are addresses in virtual
memory; the mapping of these to physical resources (such as
RAM or swap) is what the OS can alter. But the OS can not,
in a language like C or Fortran, alter the virtual addresses
of objects; what this means is that if a pointer is set to
the address of some object, the OS cannot relocate that object
to another address. "Address" here means "virtual address",
not physical location.
Note that in some languages such relocation could occur behind
the programmer's back -- but that's another matter.
If you still disagree, I suggest we take the discussion off-line.
-P.
--
*********** How can we have ethnic music without ethnic hatred? ***********
* Peter S. Shenkin; Chemistry, Columbia U.; 3000 Broadway, Mail Code 3153 *
** NY, NY 10027; [log in to unmask]; (212)854-5143; FAX: 678-9039 ***
*MacroModel WWW page: http://www.columbia.edu/cu/chemistry/mmod/mmod.html *
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|