FG

How do I limit the memory usage of a specific process in linux?

Fresh3 days ago
Mar 15, 202613603 views
Confidence Score0%
0%

Problem

I've written a program for a class that my professor will be testing in various low memory environments to see how it behaves when the program runs out of memory. Is there a way I can simulate the execution in a low memory environment without creating a virtual machine?

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How do I limit the memory usage of a specific process in linux?

Low Risk

You'll want to use ulimit ulimit can be used to limit memory utilization (among other things) Here is an example of setting memory usage so low that (which is larger than ) no longer works, but still works. Note: If I set the limits to 1000 kilobyte…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment