| From | Sent On | Attachments |
|---|---|---|
| Randy Bush | Jun 5, 2005 8:36 am | |
| Arne Wörner | Jun 5, 2005 8:43 am | |
| Randy Bush | Jun 5, 2005 8:47 am | |
| Matt Emmerton | Jun 5, 2005 11:14 am | |
| Garance A Drosihn | Jun 5, 2005 11:16 am | |
| Scott Long | Jun 5, 2005 8:59 pm | |
| Randy Bush | Jun 5, 2005 9:16 pm | |
| Julian Elischer | Jun 6, 2005 11:01 pm | |
| Randy Bush | Jun 6, 2005 11:03 pm | |
| Eric Anderson | Jun 7, 2005 12:31 pm | |
| Robert Watson | Jun 7, 2005 4:55 pm | |
| Dag-Erling Smørgrav | Jun 8, 2005 7:25 am | |
| Giorgos Keramidas | Jun 8, 2005 7:46 am | |
| Dag-Erling Smørgrav | Jun 8, 2005 7:50 am | |
| Colin Percival | Jun 8, 2005 7:52 am | |
| Giorgos Keramidas | Jun 8, 2005 8:02 am | |
| Giorgos Keramidas | Jun 8, 2005 8:02 am | |
| Arne Wörner | Jun 8, 2005 8:13 am | |
| Arne Wörner | Jun 8, 2005 9:28 am | |
| Charles Swiger | Jun 8, 2005 4:06 pm | |
| Bakul Shah | Jun 9, 2005 7:10 pm | |
| Poul-Henning Kamp | Jun 9, 2005 7:15 pm |
| Subject: | you are in an fs with millions of small files | |
|---|---|---|
| From: | Poul-Henning Kamp (ph...@phk.freebsd.dk) | |
| Date: | Jun 9, 2005 7:15:37 pm | |
| List: | org.freebsd.freebsd-fs | |
In message <2005...@gate.bitblocks.com>, Bakul Shah writes:
Start with a small array. When it gets full double it (or grow by half if you want to waste less memory).
If I might make an observation...
You do not waste malloc'ed memory until you access it. You waste some page table entries etc in the kernel, but the actual pages do not become part of the memory-pressure mob-rule until you touch it the first time.
This is a very important point which people still (after 20 years of virtual memory systems and 10 years of phkmalloc) still do not seem to have fully understood.
I would advice a simple doubling and a terminal realloc to cut down to actual size.
-- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 ph...@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.





