Re: Fragmenting memory



Hi Ray,

> Thx for the info. So it's only a problem if the MM can't merge the free
> chunks.

No, all memory managers have to contend with fragmentation to a lesser or
larger extent. Consider the following sequence:

1) allocate a block of size x bytes
2) allocate a block of size 1 byte
3) free the block allocated in step 1
4) x = x + 1
5) go back to step 1

You will note that if the block in step 2 was placed directly after the
block allocated in step 1 in the address space, that on the next pass this
block (freed in step 3) will not be useable, because the new request is for
1 byte larger. Eventually you will run out of address space due to this
fragmentation.

The RTL MM is particularly vulnerable to this. For example code refer to the
Fragmentation Benchmark inside the Fastcode MM Challenge B&V.

Regards,
Pierre


.



Relevant Pages

  • Re: [PATCH] reiserfs: eliminate minimum window size for bitmap searching
    ... the drive's cache anyway will perform better than 128k chunks spread all ... even more fragmentation on an already fragmented file system. ... can in a particular bitmap before moving on to another one. ...
    (Linux-Kernel)
  • Re: Fastcode MM Performance
    ... > effects of fragmentation, rather than assessing the fragmentation in and ... doesn't apply to memory managers at all. ... managers with identical sequences of allocation/reallocation/free requests ... The Fastcode benchmark isn't perfect and I do disagree how exactly the ...
    (borland.public.delphi.language.basm)
  • Re: Tablespace size
    ... I think fragmentation can become a blessing for ... it's more of an irritaion than a serious issue - just like 2g chunks ... But then I'm not advertising Informix as "Set and Forget" (a strapline ...
    (comp.databases.informix)