今天在查看一个大的文件时突然报出一个du: fts_read 失败: 无法分配内存的错误。
用
ulimit -a
查看下
core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 63795 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 10240 cpu time (seconds, -t) unlimited max user processes (-u) 63795 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited
原来stack size (kbytes, -s) 10240 //只有10M
修改下大小
1 [root@180caldomain ~]# ulimit -s 2140260 2 [root@180caldomain ~]# ulimit -a 3 core file size (blocks, -c) 0 4 data seg size (kbytes, -d) unlimited 5 scheduling priority (-e) 0 6 file size (blocks, -f) unlimited 7 pending signals (-i) 63795 8 max locked memory (kbytes, -l) 64 9 max memory size (kbytes, -m) unlimited 10 open files (-n) 1024 11 pipe size (512 bytes, -p) 8 12 POSIX message queues (bytes, -q) 819200 13 real-time priority (-r) 0 14 stack size (kbytes, -s) 2140260 15 cpu time (seconds, -t) unlimited 16 max user processes (-u) 63795 17 virtual memory (kbytes, -v) unlimited 18 file locks (-x) unlimited
OK