Goodbai CU BLOGgoodbai.blog.chinaunix.net
jsjwolf
全部博文(40)
2010年(8)
2009年(32)
beyondfl
xmt_xmt
zhanggf8
ak2008
tjyuanxi
ertou
erazy0
fhqfghgd
vhjghnkm
分类: LINUX
2010-01-01 01:32:32
while [ 1 ]; do echo test; done
renice -n -20 PID
#include <stdio.h> void main (){ int i = 0; char *mem; unsigned size = 10 * 1024 * 1024; unsigned val = (10 * size) + size; while (1){ mem = malloc (val); if (mem == NULL){
val = val - size; break; } //printf ("mem :%u-%u\n", val, val / (1024 * 1024)); free (mem); val = val + size; } printf ("MAX malloc:%u-%u\n", val, val / (1024 * 1024)); mem = malloc (val); while (1){ for (i = 0; i < val ; i++) { *(mem + i) = 1; } } }
gcc -g -o test test.c
./test
上一篇:告诉自己几个事情
下一篇:成功的认识
登录 注册