ulimit gets or sets the upper limit for resources available to the current shell.
Questions tagged [ulimit]
356 questions
6
votes
2 answers
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
- 7,300
- 6
- 32
- 55
6
votes
2 answers
Ulimits on AWS ECS Fargate
The default ULIMIT "NOFILE" is set to 1024 for containers launched using Fargate. So if I have a cluster of let's say 10 services with two or three tasks each (all running on Fargate), what are the implications if I set them all to use a huge NOFILE…

Tom
- 61
- 1
- 2
6
votes
0 answers
MacOs: increase maximum of opened files doesn't work for java program
My OS is MacOs sierra, and I increase the maximum of opened files for each process using following commands and make them permanently affected:
$ sysctl kern.maxfiles
kern.maxfiles: 12288
$ sysctl kern.maxfilesperproc
kern.maxfilesperproc: 10240
$…

pyb1993
- 125
- 6
6
votes
3 answers
About causing too many open files with java?
When review colleague's code , found below code
BufferedReader br = new BufferedReader(new FileReader(PATH + fileName));
//...
just read a file and concat these lines as a one line, but I do not found any close code, So I think it should…

zhuguowei
- 8,401
- 16
- 70
- 106
6
votes
1 answer
Enable Core Dumps for crashed process in macOS Sierra
I need to enable Core Dump File creation for processes which terminated by SIGABRT,SIGBUS, etс..
In previous versions of MAC OS X (include ElCapitan) to enable Code Dumps file for all processes i'm will do:
sudo sysctl -w…

aax
- 349
- 2
- 8
6
votes
6 answers
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 executes correctly, i'm still limited to 256.
Here is the…

acemtp
- 2,971
- 6
- 34
- 43
6
votes
1 answer
Java and virtual memory ulimit
I am trying to use java in an environment where the virtual memory is limited to 2GB by ulimit -v 2000000 but I get memory errors. Running java -version in this environment gives:
$ java -version
Error occurred during initialization of VM
Could not…

Barry Hurley
- 567
- 1
- 5
- 18
6
votes
3 answers
Why lsof report a higher open files number than ulimit's "open file" output
Tomcat runs on my workstation for several days, now it has no response, lsof command outputs lots of close_wait state connections, tomcat pid is 25422, however the ulimit command shows that the "open file" is 1024, how can this…

Matt Suo
- 81
- 1
- 8
5
votes
1 answer
(node) Hit max file limit?
I keep getting an error in my node.js instance where it reports the error:
(node) Hit max file limit. Increase "ulimit - n"
Yet when I check my ulimit -n, it says 65535.
There is no way in hell my app is opening 65535 connections.
Does anyone have…

kidcapital
- 51
- 1
- 2
5
votes
0 answers
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 thread (have 1306 already; errno=11)
runtime: may…

sbs
- 1,139
- 3
- 13
- 19
5
votes
1 answer
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 doesn't seem to have all the information ulimit…

Wesley Wang
- 67
- 1
- 5
5
votes
1 answer
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, that fs seems to no longer be able to open fifos…

Sami
- 648
- 8
- 25
5
votes
3 answers
Docker build --ulimit flag has no effect
My docker builds are failing because of a file handle limit error. They crash out with
Error: EMFILE: too many open files
when I check ulimit -n on the container I see
-n: file descriptors 1024
So I pass the following flags to my build…

Cheyne
- 1,964
- 4
- 27
- 43
5
votes
1 answer
Docker service with ulimit
The approach used to set the ulimit on a container does not work for services.
For containers, it's as simple as passing a ulimit parameter on the docker run command.
For services, is is possible on the command line? Ulimit is not recognized as a…

Rubber Duck
- 2,997
- 2
- 20
- 25
5
votes
1 answer
Windows Git Bash - ulimit - too many open files
I wanted to increase the limit on the number of open files on Windows 7 (64-bit). Using Git Bash for my command line environment, I enter the following command:
$ ulimit -n 9999
However, I encounter the following error:
bash: ulimit: open files:…

datinfo
- 51
- 1
- 3