lkml.org 
[lkml]   [2005]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PROBLEM] Badness in out_of_memory (Plain)
On Thu, Jan 06, 2005 at 06:51:18PM +0100, Richard Ems wrote:
> this! Do you know a memory eater program other than starting lots of
> mozilla's, OpenOffices's, etc.?

You can run a few of this.

#include <stdio.h>
#include <time.h>

main()
{
char *p[160];
int i, j;
int count;
for (j=0; j<160; j++)
{
p[j] = (char *) malloc(10000000);
}
for (count=0;count<2000;count++)
{
for (j=0; j<160; j++)
{
for (i=0; i<10000000; i+= 4096)
p[j][i] = 0;
}
pause();
}
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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