Re: Out of memory: system();

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ed K. kirjoitti viestissään (lähetysaika lauantai, 12. kesäkuuta 
2004 02:11):
> I do have a working test:
>
> #include <stdio.h>
> #include <unistd.h>
> #include <stdlib.h>
> #include <errno.h>
>
> int main(int argc, char *argv[])
> {
>    unsigned char *data;
>    int i;
>
>    data=malloc(500*1024*1024);
>    memset(data,0,500*1024*1024);
>
>    for (i=0; i<100000; i++)
>      system("cat /proc/meminfo");
> }
>
> This does not cause problems on FC1 (kernel 2.4.22-1.2188) But
> does on FC2 (kernel 2.6.5-1.358)

I ran this program successfully on FC2 with kernel 2.6.6-1.424, 
512MB RAM and 1GB swap. No signs of memory leaking.

-- 
	Markku Kolkka
	markku.kolkka@xxxxxx



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux