Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query about swapping etc #12

Open
tomjridge opened this issue Nov 3, 2021 · 1 comment
Open

Query about swapping etc #12

tomjridge opened this issue Nov 3, 2021 · 1 comment

Comments

@tomjridge
Copy link

Just a quick question: how do you ensure that the memory is actually allocated in main RAM? What stops the OS from swapping the memory out? Or pushing it to disk as virtual memory?

@whitis
Copy link

whitis commented Jan 19, 2023

It doesn't. The program fails to do what it says on the tin. It only uses up virtual memory not physical memory. It needs to call mlock() or mlockall() to lock those pages into RAM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants