Can you stop memory from being swapped to disk?

后端 未结 7 950
北恋
北恋 2021-01-02 02:59

I was wondering if it was possible to prevent memory of a object (class or struct) from being swapped to disk?

Edit: As for why I\'ve been told some of the data I\'m

相关标签:
7条回答
  • 2021-01-02 03:48

    Depending on your environment you can also do this at the OS level instead - just use a really beefy machine with a lot of RAM, and disable paging/swap entirely. It does mean you better not ever overrun that RAM, but that's where the task comes back to C# - you can constrain max memory usage with smart design.

    https://www.howtogeek.com/126430/htg-explains-what-is-the-windows-page-file-and-should-you-disable-it/

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