Resource Limits on the Linux Clients
Our undergraduate Linux clients have system-enforced limits on some programs' resource usage. These limits are designed to prevent runaway programs from impacting other people's use of the shared computers. The limits should not affect your routine use of the systems; if you believe they're causing problems, please contact us to discuss the issue.
For some guidance on not exceeding these limits, please see our page on Preventing Your Programs From Overrunning Our Computers.
Memory Usage
The maximum memory (RAM) usage for a program is 2 GiB.
Note that this limit applies collectively to every program started from the same login session. Running one program that uses 2 GiB of RAM will hit the limit, but so will running four programs that each use 512 MiB of RAM.
When your program hits the memory limit, any further attempts to allocate memory will fail. How that failure is manifested will depend on your programming language. In C, malloc()
(or another memory allocation function) will return NULL
and errno
will be set to ENOMEM
. In Python, a MemoryError
exception will be raised. In Java, an OutOfMemoryError
will be raised. For other languages, please consult the relevant documentation.
Number of Processes
We have a limit of 1024 processes per login session.
Note that this limit applies to processes, not threads. We do not currently have a limit on number of threads per login session, though we might revisit this setting in the future if need arises.
If the total number of running processes started from the same login session is at the limit, attempts to start any additional processes will fail. How that failure is manifested will depend on the program that tried to launch the additional process. In C, fork()
will return -1 and errno
will be set to EAGAIN
. A shell will typically give a message along the lines of "fork failed: Resource temporarily unavailable". In Python, you will typically get a BlockingIOError
with a message of "[Errno 11] Resource temporarily unavailable". The Java exception raised will vary depending on the function having been called; for instance, java.util.concurrent.ForkJoinPool.execute()
will raise java.util.concurrent.RejectedExecutionException
.
Maximum Process Runtime
Any program that has consumed more than 1 week of accumulated CPU time will be terminated.
"Accumulated CPU time" is the total amount of time spent actively using a single CPU core. A single-threaded process running continuously for one week will accumulate 1 week of CPU time. A process with seven threads, all running continuously, will accumulate seven seconds of CPU time for every actual elapsed second and will accumulate 1 week of CPU time after running for one day.
When a program exceeds the CPU time limit, it will be sent the SIGXCPU
signal. If the program has no registered handler for that signal, it will simply stop running and its parent process will be notified. If it has a registered signal handler, the handler will be given about 30 seconds of runtime to clean up any resources before the process is ended. The process will be sent a new SIGXCPU
signal every second until it exits. If it's still running after 30 seconds, the process will be forcibly terminated.
Disk Usage
Ugrad systems are also subject to disk usage limits, as described on the Disk Quotas page.
If your disk usage is at its limit, attempts to write additional data to files in the /home
filesystem will fail. In C, the write()
function will return -1 and errno
will be set to EDQUOT
(or, in some cases, ENOSPC
). Python will raise an OSError
exception with message "[Errno 122] Disk quota exceeded". Java might not raise an exception and instead might just silently fail to write the data.