Re: Bug#256871: cdrecord triggers memory leak in kernel space
From: Joerg Schilling
Date: Tue Jul 06 2004 - 04:56:24 EST
Hi,
I would not believe that there is a big memory leak in Linux.
However, you seem to missunderstand me:
The problem is not that Linux incorrectly believes that there is no memory.
The problem is that Linux _before_ believes that there is _plenty_ of memory
although there is none left over.
Try this:
char buf[16*1024*1024];
main()
{
int i;
int ret;
for (i = 0; i < 1000; i++) {
if (ret == 0)
sleep(1000);
if (ret < 0) {
perror("fork");
printf("i: %d\n", i);
exit(1);
}
}
}
On Solaris, you will see something like:
fork: Not enough space
i: 53
On Linux, I asume that you will see no error message.....
If you modify the loop to:
for (i = 0; i < 1000; i++) {
if (ret == 0) {
sleep(10);
memset(buf, 0, sizeof(buf));
sleep(1000);
}
...
You will see the same problems as you did describe.
J?rg
--
EMail:joerg@xxxxxxxxxxxxxxxxxxxxxxxxxxx (home) J?rg Schilling D-13353 Berlin
js@xxxxxxxxxxxxxxx (uni) If you don't have iso-8859-1
schilling@xxxxxxxxxxxxxxxxxxx (work) chars I am J"org Schilling
URL: http://www.fokus.fraunhofer.de/usr/schilling ftp://ftp.berlios.de/pub/schily
-------------------------------------------------------------------------------
Information forwarded to debian-bugs-dist@xxxxxxxxxxxxxxxx, Joerg Jaspert
<joerg@xxxxxxxxxx>:
Bug#256871; Package cdrecord. Full text available.
-------------------------------------------------------------------------------
Acknowledgement sent to Jeff King <peff-debbug@xxxxxxxx>:
Extra info received and forwarded to list. Copy sent to Joerg Jaspert
<joerg@xxxxxxxxxx>. Full text available.
-------------------------------------------------------------------------------
Message received at 256871@xxxxxxxxxxxxxxx:
Received: (at 256871) by bugs.debian.org; 6 Jul 2004 21:02:11 +0000