Can I tell Linux not to swap out a particular processes' memory?

后端 未结 7 1946
孤城傲影
孤城傲影 2020-12-02 13:29

Is there a way to tell Linux that it shouldn\'t swap out a particular processes\' memory to disk?

Its a Java app, so ideally I\'m hoping for a way to do this from th

相关标签:
7条回答
  • 2020-12-02 13:56

    Why do you want to do this?
    If you are trying to increase performance of this app then you are probably on the wrong track. The OS will swap out a process to increase memory for disk cache - even if there is free RAM, the kernel knows best (actauly the samrt guys that wrote the scheduler know best).
    If you have a process that needs responsiveness (it's swapped out while not used and you need it to restart quickly) then nice it to high priority, mlock, or using a real time kernel might help.

    0 讨论(0)
提交回复
热议问题