Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How does "nice" affect memory usage? 1

Status
Not open for further replies.

tgs4

Technical User
Oct 23, 2009
1
US
I am running 2 processes, both of which are memory pigs. One requests 14.5GB of memory, and the other 12.3GB of memory. My system only have 16GB of physical RAM available. I would like to run one of the processes at a lower priority, forcing it to use the swap file.

If I "nice", or "renice" the lower priority process, will that affect it's memory usage? Or at least it's physical memory usage?

The last time I tried this without "nice", my second (sequentially speaking) process ended up getting "kill -9"-ed by the system because it requested too much physical memory.
 
As I understand it, "nice" only affects process priority, which affects scheduling. It will change how much CPU the process gets over time, not how much physical memory it uses.

So, his will have NO affect on the total size of the process. The process will be as big as it needs to be regardless of how much CPU it's getting.

A process can't "run" from the swap file. It will only swap pieces of itself that aren't really needed. But even those pieces will be swapped back in when needed by the program.

If you can have your sysadmin add some big swap files, you will end up using them more because you're running out of the physical resource of actual memory. It sound like you're running out of actual memory AND swap space.

 
Check out ulimit. It can set limits to swap and RAM usage for the user. If you have each process running under a separate user you can set distinct limits for both processes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top