Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a possibility to prevent swapping for a single process?
This process is an in-memory-database and should not be moved to virtual ram.

all other processes should still be swap-able.

I need something like the "lock pages in memory" option of the SQL-Server.

share|improve this question
add comment

1 Answer

If a process starts swapping, it's either very poorly coded and not releasing RAM when it should or your server doesn't have enough RAM available to handle all the tasks it's currently performing and you should expand the RAM capacity.

If that's really not an option budget-wise or if the machine is already at maximum RAM capacity, you could schedule a task that kills and restarts the process every hour or so (or more frequent if needed). Note that this should really be a last-resort and temporary solution, as it's not really so much of a solution, but just a work-around.

As for the core of your question, there is no way that I know of to prevent a program from swapping. It's basic OS behaviour when a process runs out of physical memory to use to prevent your machine from crashing.

share|improve this answer
    
The server already has very much RAM. And even if everything is loaded there are still 20 GB RAM available. Dont know why the system begins to page the process but it does :( –  Guybrush Threepwood Nov 24 '11 at 11:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.