Re: fragmentation
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Mon, 28 May 2007 08:14:52 +0000
drop669@xxxxxxxxx said:
Hi.
I'm writting my own memory management functions.
While playing with different options, I feel necessity of
fragmentation counting algorithm.
For example, 1 is allocated block and 0 is not.
This is 0% fragmentation: 11111100000
This is 100% fragmentation: 101010101010
How can I build algorithm which will count this coefficient?
Try this and tell me why it doesn't work:
1) count the number of times "10" occurs. (If it's 0 or 1, stop right
there, and the fragmentation is 0%.)
2) subtract 1 (because one boundary is allowed).
3) multiply by 100 (because we want a percentage).
4) divide by whatever you consider appropriate - e.g. number of 1-bits
is a likely candidate.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
.
- References:
- fragmentation
- From: drop669
- fragmentation
- Prev by Date: Re: Schools working to overhaul the art of computer programming (The Columbian)
- Next by Date: Witrix : web based home PC remote access (freeware)
- Previous by thread: fragmentation
- Next by thread: Re: fragmentation
- Index(es):