Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 149305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:06:35+00:00 2026-05-11T09:06:35+00:00

Is there a way to tell Linux that it shouldn’t swap out a particular

  • 0

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 the command line.

I’m aware that you can set the global swappiness to 0, but is this wise?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T09:06:35+00:00Added an answer on May 11, 2026 at 9:06 am

    You can do this via the mlockall(2) system call under Linux; this will work for the whole process, but do read about the argument you need to pass.

    Do you really need to pull the whole thing in-core? If it’s a java app, you would presumably lock the whole JVM in-core. I don’t know of a command-line method for doing this, but you could write a trivial program to call fork, call mlockall, then exec.

    You might also look to see if one of the access pattern notifications in madvise(2) meets your needs. Advising the VM subsystem about a better paging strategy might work out better if it’s applicable for you.

    Note that a long time ago now under SunOS, there was a mechanism similar to madvise called vadvise(2).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Can I tell Linux not to swap out a particular processes' memory?
Is there any way to tell GCC to not initialize a particular global array
Is there a way to tell the php complier that I want a specific
Is there a way to tell scons to use a particular file to setup
Is there a way to tell how to get a file size that is
Is there any way to tell db4o to call class default constructor while activating
Is there a way to tell excel to not display non-significant series in a
Is there a way to tell ifort or gfortran to just try to parse
Is there a way to tell Visual Studio 2005 to not rearrange your SSIS
is there some way to tell sql server to use the (nolock) hint or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.