Article View: comp.sys.powerpc
Article #2325Re: Ask yourself these before you choosing a 32bit OS...
From: Jeff Dege
Date: Mon, 25 Sep 1995 02:08
Date: Mon, 25 Sep 1995 02:08
37 lines
2819 bytes
2819 bytes
On 24 Sep 1995 18:20:19 -0700, Kazimir Kylheku (c2a192@ugrad.cs.ubc.ca) wrote:
: In article <DFBHIv.8F2@wombat.hanse.de>,
: Bernd "Bernie" Meyer <root@wombat.hanse.de> wrote:
: >BTW, I just had to learn about fragmentation for an exam --- there is
: >the so called "Knuth's 50% rule" which says that, after extended usage,
: >only 2/3 of the memory will hold meaningful data and the rest is lost
: >to fragmentation.
:
: I'm going to have to dig up that Knuth!
"The Art of Computer Programming, vol. 1, (2ed)", p. 445.
The rule applies to systems that use first-fit allocation and merging of
adjacent blocks on deallocation, and when allocations of partial blocks are
made (i.e., if we need 197 bytes, and the first free block has 800 bytes,
we return, say 200 bytes, and keep a 600-byte block in the free list.
Assuming that blocks have random lifetimes, (which may or may not
be a reasonable assumption), when the system is near equilibrium, and when
we are rounding up allocations by a small amount, and when block sizes are
infrequently equal to one another, we end up with approximately half as
many free blocks as we have allocated blocks in the list.
I'm not certain that these assumptions have any value when considering
the behavior of an individual program, and with VM, this rule might _ONLY_
apply to an individual program's heap. Allocation of pages from the OS
are always done in even multiples of the page size, which invalidates the
rule. Even within a single program's heap, the random lifetime assumption
is questionable, as is the infrequently equal size assumption.
In any case, Knuth does _NOT_ imply that said free blocks are lost to
fragmentation. They are very much available, and will be used, if necessary.
--
the Windows API has done more to retard skill development
than anything since COBOL maintenance.
--Larry O'Brien
Technical Details
Message-ID:
<4452us$gpb@blackice.winternet.com>Path:
arc1-ca.pugleaf.net!winternet.com!not-for-mailReferences:
<3vh2hc$9dd@falcon.ccs.uwo.ca> <nevin-1709951616450001@mac-nevin.cs.arizona.edu> <43kai7INNjvp@anvil.ugrad.cs.ubc.ca> <DFBHIv.8F2@wombat.hanse.de> <44504jINN43m@keats.ugrad.cs.ubc.ca>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!winternet.com!not-for-mail From: jdege@winternet.com (Jeff Dege) Newsgroups: comp.sys.powerpc,comp.os.linux.advocacy,comp.sys.mac.advocacy,comp.os.os2.advocacy,comp.sys.amiga.advocacy,comp.sys.intel,comp.os.ms-windows.advocacy Subject: Re: Ask yourself these before you choosing a 32bit OS... Followup-To: comp.sys.powerpc,comp.os.linux.advocacy,comp.sys.mac.advocacy,comp.os.os2.advocacy,comp.sys.amiga.advocacy,comp.sys.intel,comp.os.ms-windows.advocacy Date: 25 Sep 1995 02:08:28 GMT Organization: StarNet Communications, Inc Message-ID: <4452us$gpb@blackice.winternet.com> References: <3vh2hc$9dd@falcon.ccs.uwo.ca> <nevin-1709951616450001@mac-nevin.cs.arizona.edu> <43kai7INNjvp@anvil.ugrad.cs.ubc.ca> <DFBHIv.8F2@wombat.hanse.de> <44504jINN43m@keats.ugrad.cs.ubc.ca> NNTP-Posting-Host: parka.winternet.com X-Newsreader: TIN [UNIX 1.3 950726BETA PL0]