首页 > 代码库 > ulimit: open files: cannot modify limit 解决

ulimit: open files: cannot modify limit 解决

在执行该命令时报下列错误

[root@ ~]# valgrind --tool=memcheck ./run
==2932== Memcheck, a memory error detector
==2932== Copyright (C) 2002-2012, and GNU GPL‘d, by Julian Seward et al.
==2932== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==2932== Command: ./run
==2932==
./run: line 56: ulimit: open files: cannot modify limit: 不允许的操作

 

修改该文件

[root@ ~]# vim /etc/security/limits.conf

*                soft nofile            65535
*                hard nofile            65535
*                soft nproc             65535
*                hard nproc             65535

 

问题解决

[root@ ~]# valgrind --tool=memcheck ./run
==2401== Memcheck, a memory error detector
==2401== Copyright (C) 2002-2012, and GNU GPL‘d, by Julian Seward et al.
==2401== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==2401== Command: ./run
==2401==

本文出自 “云人生” 博客,请务必保留此出处http://ovcer.blog.51cto.com/1145188/1586079

ulimit: open files: cannot modify limit 解决