Re: GC performance - GC fragility
- From: "Martin Harvey" <martin@xxxxxxxxxxxxxxxxxxxxxx>
- Date: 28 Jan 2008 18:55:02 -0700
Andre Kaufmann wrote:
The point you are missing, that it's still a linear address space, or
isn't the address space each process has 2 GB linear ? Isn't the
whole process and the system using virtual memory ? Isn't GC >not
using< virtual memory ?
In a virtual block of memory and free the 3 bytes and 4 bytes and
want to allocate 8 bytes, the hole inside this "virtual memory" block
can't be used or filled by a native heap. No way.
Welllll.... actually, it's not quite that simple. When you allocate
memory, you allocate two separate things from the operating system:
1. Virtual Address space.
2. Physical storage.
The point is that when it comes to doing things like a re-alloc, since
you're allowing the address to be changed, the OS can change the
virtual address of the memory, and hence the apparent location, without
doing any actual memory copying, simply by changing the page tables.
This means that in some cases you can reduce fragementation. e.g:
In virtual address space:
1M allocated, 1M free, 1M allocated, 1M free. 1M allocated.
Now lets say that you realloc the middle 1M to 512K.
If you ask the OS to do that (and not a subsidiary heap), there's
nothing to stop it remapping the pages so that you end up with:
1M allocated, 3M Free, 1M Allocated, 512K allocated.
Admittedly, everything is "modulo page size", but the point is that
fragmentation for quantities bigger than a page size is still *virtual
fragementation*.
MH.
.
- Follow-Ups:
- Re: GC performance - GC fragility
- From: Andre Kaufmann
- Re: GC performance - GC fragility
- References:
- GC performance - GC fragility
- From: Eric Grange
- Re: GC performance - GC fragility
- From: Atmapuri
- Re: GC performance - GC fragility
- From: Andre Kaufmann
- Re: GC performance - GC fragility
- From: Micha Nelissen
- Re: GC performance - GC fragility
- From: Andre Kaufmann
- Re: GC performance - GC fragility
- From: Eric Grange
- Re: GC performance - GC fragility
- From: Andre Kaufmann
- GC performance - GC fragility
- Prev by Date: Re: What's the big deal with cross-platform?
- Next by Date: Re: GC performance - GC fragility
- Previous by thread: Re: GC performance - GC fragility
- Next by thread: Re: GC performance - GC fragility
- Index(es):
Relevant Pages
|