[lkml]   [2001]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectVery bad behavior of kswapd
Try this (my example I've 2GB of ram)

turn all your swap off

dd about 15% of the size of your RAM:
dd if=/dev/zero of=/local/test count=300 bs=1000000

Run this program with SIZE about 95% of your RAM:

#include <stdlib.h>
#include <unistd.h>
#include <assert.h>

#define SIZE (1900 * 1024 * 1024)
int main()
int i;
char *p = malloc(SIZE);
assert (p != NULL);
for (i = 0; i < SIZE; i++)
p[i] = 1;
printf ("done %p\n", p);

while (1)
sleep (60);
return 0;

Watch top: when this program needs the memory that kswapd keep in cache they go
both at 100% cpu (on SMP) but still the size of the program only grows at about
100KB/s, why is kswapd releasing it so slowly and taking so much CPU ?

Laurent Chavet

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:26    [W:0.061 / U:0.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site