Questions tagged [ulimit]

ulimit gets or sets the upper limit for resources available to the current shell.

ulimit
Filter by
Sorted by
Tagged with
63 votes
9 answers
198k views

how to set ulimit / file descriptor on docker container the image tag is phusion/baseimage-docker

I need to set the file descriptor limit correctly on the docker container I connect to container with ssh (https://github.com/phusion/baseimage-docker) Already tried: edit limits.conf the ...
dnocode's user avatar
  • 2,028
20 votes
4 answers
21k views

Is there a limit of stack size of a process in linux

Is there a limit on the stack size of a process in Linux? Is it simply dependent on the RAM of the machine? I want to know this in order to limit the depth of recursive calls to a function.
michael's user avatar
  • 108k
79 votes
10 answers
247k views

How to increase Neo4j's maximum file open limit (ulimit) in Ubuntu?

Currently ulimit -n shows 10000. I want to increase it to 40000. I've edited "/etc/sysctl.conf" and put fs.file-max=40000. I've also edited /etc/security/limits.conf and updated hard and soft values. ...
theharshest's user avatar
  • 7,817
65 votes
3 answers
154k views

What does "ulimit -s unlimited" do?

There are understandably many related questions on stack allocation What and where are the stack and heap? Why is there a limit on the stack size? Size of stack and heap memory However on various *...
Brian Hawkins's user avatar
37 votes
3 answers
11k views

How to limit memory of a OS X program? ulimit -v neither -m are working

My programs run out of memory like half of the time I run them. Under Linux I can set a hard limit to the available memory using ulimit -v mem-in-kbytes. Actually, I use ulimit -S -v mem-in-kbytes, so ...
hectorpal's user avatar
  • 711
29 votes
5 answers
82k views

How to change the stack size using ulimit or per process on Mac OS X for a C or Ruby program?

It seems that the recommended way to set stack size for a C program or Ruby program (which uses the C stack), is by using ulimit in the Bash shell. But $ ulimit -s 8192 $ ulimit -s 16384 -bash: ...
nonopolarity's user avatar
8 votes
2 answers
33k views

Windows equivalent of ulimit -n

What is the windows equivalent of the unix command " ulimit -n" ? Basically, i want to set the maximum fd limit via command prompt.
maximus1986's user avatar
24 votes
1 answer
20k views

How to limit memory usage within a python process

I run Python 2.7 on a Linux machine with 16GB Ram and 64 bit OS. A python script I wrote can load too much data into memory, which slows the machine down to the point where I cannot even kill the ...
Arne's user avatar
  • 18.9k
16 votes
3 answers
56k views

Too many open files ( ulimit already changed )

I'm working on a debian server with tomcat 7 and java 1.7. This is an application that recieves several TCP connections, each TCP connection is an open file by the java process. Looking at /proc/pid ...
slacker's user avatar
  • 478
48 votes
3 answers
34k views

Python: ulimit and nice for subprocess.call / subprocess.Popen?

I need to limit the amount of time and cpu taken by external command line apps I spawn from a python process using subprocess.call , mainly because sometimes the spawned process gets stuck and pins ...
Parand's user avatar
  • 105k
20 votes
4 answers
15k views

Resident Set Size (RSS) limit has no effect

The following problem occurs on a machine running Ubuntu 10.04 with the 2.6.32-22-generic kernel: Setting a limit for the Resident Set Size (RSS) of a process does not seem to have any effect. I ...
BrainCore's user avatar
  • 5,314
6 votes
1 answer
5k views

What is Python's equivalent to 'ulimit'?

I'm trying to implement a check on system resources for the current shell (basically everything in ulimit) in Python to see if enough resources can be allocated. I've found the resource module, but it ...
Wesley Wang's user avatar
6 votes
2 answers
12k views

Max open files per process

What is a maximum open files count in Mac OS X (10.6) per process? ulimit said than 256, sysctl said 10240, but my test program can create 9469 (under gdb), 10252 (without gdb) files..
Dmitry's user avatar
  • 7,330
6 votes
6 answers
12k views

How to increase the limit of "maximum open files" in C on Mac OS X

The default limit for the max open files on Mac OS X is 256 (ulimit -n) and my application needs about 400 file handlers. I tried to change the limit with setrlimit() but even if the function ...
acemtp's user avatar
  • 2,999
31 votes
3 answers
16k views

How do I close the files from tempfile.mkstemp?

On my machine Linux machine ulimit -n gives 1024. This code: from tempfile import mkstemp for n in xrange(1024 + 1): f, path = mkstemp() fails at the last line loop with: Traceback (most ...
Hooked's user avatar
  • 86.4k
14 votes
1 answer
15k views

How to set ulimit -n from a golang program?

My purspose was to set ulimit -n from within a golang program so that I do not have to set it globally but restrict it within the program. Found systemcalls setrlimit and get rlimit for the same. (...
George Thomas's user avatar
9 votes
4 answers
11k views

How do I set a ulimit from inside a Perl script that applies to its children?

I have a Perl script that does various installation steps to set up a development box for our company. It runs various shell scripts, some of which crash due to lower than required ulimits (...
Artem Russakovskii's user avatar
5 votes
2 answers
7k views

increase ulimit for # of file descriptors

As normaluser: $ ulimit -n 4096 -bash: ulimit: open files: cannot modify limit: Operation not permitted As root it works as desired - but then it won't affect normaluser. How to get out of this ...
djechlin's user avatar
  • 60.1k
3 votes
1 answer
7k views

From terminal in ubuntu, change ulimit for file descriptor number

Fron the terminal I am trying to change the number of file descriptions open and they will not stick. How, from the terminal do I change the ulimit? Per the below, when I run uwsgi from the terminal, ...
Tampa's user avatar
  • 77k
3 votes
1 answer
9k views

Finding hard and soft open file limits from within jvm in linux (ulimit -n and ulimit -Hn)

I have a problem where I need to find out the hard and soft open file limits for the process in linux from within a java/groovy program. When I execute ulimit from the terminal it gives separate ...
Dipayan's user avatar
  • 113
2 votes
0 answers
305 views

Opening millions of numpy.memmaps in python

I have a database composed of millions of training examples. Each is saved as its own numpy.memmap. (Yes, yes, I know, but they're of irregular sizes. I probably will modify my design to put like-size ...
Pavel Komarov's user avatar
2 votes
1 answer
3k views

How can I increase OpenFabrics memory limit for Torque jobs?

When I run MPI job over InfiniBand, I get the following worning. We use Torque Manager. -------------------------------------------------------------------------- WARNING: It appears that your ...
kojiwell's user avatar
  • 872
0 votes
1 answer
375 views

linux ulimit with java does not work properly

I run code on linux ubuntu 17.10 public class TestExec { public static void main(String[] args) { try { Process p = Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c", "ulimit", "-n"})...
Michal's user avatar
  • 109
38 votes
3 answers
20k views

Ulimits in Docker host vs container

I wasn't able to find straight answer, to this question, but here it is: Let's say that I have a host which has max open files 1024: [root@host]# ulimit -a open files (-n) 1024 ...
os11k's user avatar
  • 1,218
22 votes
6 answers
11k views

React Native + Jest EMFILE: too many open files error

I am trying to run Jest tests, but I'm getting the following error: Error reading file: /Users/mike/dev/react/TestTest/node_modules/react-native/node_modules/yeoman-environment/node_modules/globby/...
Mike Hedman's user avatar
  • 1,431
21 votes
2 answers
25k views

Docker Ignores limits.conf (trying to solve "too many open files" error)

I'm running a web server that is handling many thousands of concurrent web socket connections. For this to be possible, on Debian linux (my base image is google/debian:wheezy, running on GCE), where ...
orcaman's user avatar
  • 6,413
14 votes
2 answers
9k views

Ubuntu 16.04 systemd redis issues with ulimit

I have been having issues with our new redis server after swapping from Ubuntu 14.04 to 16.04. The configuration of the open files limit using all the guides says to change the /etc/security/limits....
Ollie's user avatar
  • 1,160
13 votes
2 answers
17k views

Why ulimit can't limit resident memory successfully and how?

I start a new bash shell, and execute: ulimit -m 102400 ulimit -a " core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 20 file ...
sean's user avatar
  • 1,362
12 votes
1 answer
16k views

Error: EMFILE: too many open files, watch, unless I use sudo

Description Recently I've run into an problem. I am not able to run yarn start in element-web directory, I get these errors. Originally I thought it had something to do with element-web itself so I ...
Šimon Brandner's user avatar
10 votes
1 answer
8k views

How to set the size of the C stack in R?

I'm trying to use the spread() function from the tidyr package in R on a dataframe that has about three million observations. It's returning the following error message: Error : C stack usage ...
s.willis's user avatar
  • 347
10 votes
2 answers
4k views

Processes resources not limited by setrlimit

I wrote a simple program to restrict it's data size to 65Kb and to verify the same i am allocating a dummy memory of more than 65Kb and logically if i am doing all correct (as below) malloc call ...
pa1's user avatar
  • 838
9 votes
1 answer
10k views

ulimit -t under ubuntu

I am running Ubuntu Linux (2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686 GNU/Linux) and it seems that the command "ulimit -t" does not work properly. I ran: ulimit -t 1; ...
Tsf's user avatar
  • 1,389
8 votes
2 answers
8k views

Limit python script RAM usage in Windows

My program can allocate suddenly a lot of RAM based on usage. I want to limit the RAM it can take from the system. I saw here: Limit RAM usage to python program But it works only for Unix. Any ...
BestR's user avatar
  • 669
8 votes
2 answers
29k views

docker-compose yaml - option to pass the 'ulimit' parameters 'rtprio' and 'memlock'

I can't find the option in the docker-compose.yaml to pass the parameters the following 'docker' parameters: --ulimit rtprio=95 --ulimit memlock=-1 In other words, I wish to wrap the following ...
Hanoch Giner's user avatar
5 votes
0 answers
13k views

runtime: failed to create new OS thread

On a 54-core machine, I use os.Exec() to spawn hundreds of client processes, and manage them with an abundance of goroutines. Sometimes, but not always, I get this: runtime: failed to create new OS ...
sbs's user avatar
  • 1,211
5 votes
1 answer
2k views

Node.js fs.open() hangs after trying to open more than 4 named pipes (FIFOs)

I have a node.js process that needs to read from multiple named pipes fed by different other processes as an IPC method. I realized after opening and creating read streams from more than four fifos, ...
Sami's user avatar
  • 665
4 votes
1 answer
9k views

How Do I run ulimit -c unlimited automatically

I am trying to provide support for coredump file generation from my rootfs ,I have modified /etc/limits file with "ulimit -c unlimited" command and "* hard core -1" ,Now when I give kill -6 $$ ,...
Amit Singh Tomar's user avatar
4 votes
4 answers
9k views

Supervisor open file limit won't change when using Chef

I am modifying /etc/security/limits.conf on the machine, and then installing Supervisor in a Chef recipe. After the recipe run finishes, if I run cat /proc/<process id>/limits I see: Limit ...
Brad's user avatar
  • 334
4 votes
3 answers
9k views

Can I set ulimit from node.js?

I'd like to restrict child processes from writing too much data or taking up too much cpu time (infinite loop). In C, I'd call setrlimit(2) to do that. Is there something like this in node.js?
topskip's user avatar
  • 16.8k
3 votes
2 answers
2k views

How to make `docker run` inherit ulimits

Running a command via docker does not seem to adhere to my currently configured ulimits: $ ulimit -t 5 ~ $ sudo -- bash -c "ulimit -t" 5 ~ $ sudo -- docker run --rm debian:wheezy bash -c "ulimit -t" ...
Joachim Breitner's user avatar
3 votes
1 answer
1k views

docker run --ulimit cpu=10 does not kill java process after timeout

I want to make sure the process gets killed after 10 seconds of CPU time. Docker run command accepts the flag --ulimit cpu=10 that is supposed to do that. However when I run java command using this, ...
JackDaniels's user avatar
3 votes
2 answers
3k views

Supervisord and ulimit to java app

I am using supervisord to start my java app. The application is working OK, but my ulimit nofiles is not set. I could do it in one machine, using debian. but there is a problem on the second machine ...
Felipe Gutierrez's user avatar
3 votes
1 answer
4k views

How do I set all ulimits unlimited for all users?

Yes, I want to remove all ulimits and set them to unlimited. How do I do this? Thanks!
bodruk's user avatar
  • 3,242
3 votes
3 answers
3k views

Limit CPU time of process group

Is there a way to limit the absolute CPU time (in CPU seconds) spend in a process group? ulimit -t 10; ./my-process looks like a good option but if my-process forks then each process in the process ...
Flogo's user avatar
  • 1,748
2 votes
1 answer
6k views

Why * in /etc/security/limits.conf doesn't include root user?

I'm running a java program as root on a linux machine. In order to increase the Max open files limitation, I added the following lines into /etc/security/limits.conf * soft nofile 1000000 * ...
kenshinji's user avatar
  • 2,061
2 votes
2 answers
5k views

Fork fails with "resource temporarily unavailable". Which resource?

I have inherited a Perl script that, depending on machine configuration, fails during calls to fork with $? == 11. According to errno.h and various posts, 11 is EAGAIN, i.e. "try again", because ...
phonybone's user avatar
2 votes
1 answer
4k views

How and when and where jvm change the max open files value of Linux?

In linux there is a limit for max open files for every process of each login user, as below: $ ulimit -n 1024 When I study java nio, I'd like to check this value. Because channel also is a file in ...
zhuguowei's user avatar
  • 8,311
2 votes
1 answer
4k views

Python - OSError 24 (Too many open files) and shared memory

I faced with the problem there was exception OSError 24 ("Too many open files") raised on my mac os x in python script. I had no idea what could caused that issue. lsof -p showed about 40-50 lines, ...
Serge's user avatar
  • 1,967
1 vote
1 answer
2k views

How do I get a core dump on OS X Lion?

I am working on a PostgreSQL extension in C that segfaults, so I want to look at the core dump file on my OS X Lion box. However, there are no core files in /cores or anywhere else that I can find. It ...
theory's user avatar
  • 9,482
1 vote
1 answer
4k views

Nodejs connect EMFILE - How to reuse connections?

I am implementing NodeJS based scripts for communicating to couchbase and another service. It is a long running script and after a while I get "connect EMFILE" for the service. My code sample is given ...
cucucool's user avatar
  • 3,837