[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees
From: |
David Allouche |
Subject: |
Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees |
Date: |
Mon, 12 Jan 2004 15:25:30 +0100 |
User-agent: |
Mutt/1.5.4i |
On Fri, Jan 09, 2004 at 10:11:36AM -0500, Aaron Bentley wrote:
> Anyone know of a utility that will clean out your cache? Or would "grep
> -r foo /" be the way to go?
That is what I use when I make benchmarks:
#include <stdlib.h>
static const int n=10000000;
int main (int argc, char** argv) {
int i, *p;
while (1) {
p=malloc (sizeof(n)*n);
for (i=0; i<n; i++) {
*p=i;
p++;
}
}
return 0;
}
What this does is just mallocing and touching memory until the kernel
out-of-memory killer nukes the program.
That flushes all kernel caches and buffers as well as possible. Only
problem is _if_ you have an oversized swap, it will be slow. Anyway
having an oversized swap is a bad thing, because real-life programs
sometimes go berserk this way, and with too big a swap they can make
your system unusable for ages before the OOM killer comes.
--
-- ddaa
- [Gnu-arch-users] Re: [PATCH] arch speedups on big trees, (continued)
- Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees, conrad, 2004/01/10
- Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees, Aaron Bentley, 2004/01/10
- Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees, Chris Mason, 2004/01/09
- Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees, Aaron Bentley, 2004/01/09
- Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees, Chris Mason, 2004/01/09
- Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees, Miles Bader, 2004/01/09
- Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees,
David Allouche <=
- Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees, Dustin Sallings, 2004/01/12
- Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees, Aaron Bentley, 2004/01/09
- Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees, Chris Mason, 2004/01/10
- Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees, Aaron Bentley, 2004/01/08
- Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees, Tom Lord, 2004/01/08
- Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees, Aaron Bentley, 2004/01/09
- Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees, Aaron Bentley, 2004/01/09
- Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees, Aaron Bentley, 2004/01/08
- Re: [Gnu-arch-users] Re: [PATCH] arch speedups on big trees, Aaron Bentley, 2004/01/09
- Re: [Gnu-arch-users] [PATCH] arch speedups on big trees, Tom Lord, 2004/01/28