Memory locking is helpful for real-time applications and/or where security is an issue, as it guarantees the residence out the memory locked and so reduces latency and/or the risk of being placed (swapped ot) to non-secure locations.
Questions tagged [memory-locking]
4 questions
4
votes
2 answers
Lock the memory to physical RAM in C for the dynamically allocate pointer
I want to lock the memory to physical RAM in C with mlock and munlock, but I'm unsure about the correct usage.
Allow me to explain in a step by step scenario:
Let's assume that I dynamically allocate a pointer using calloc:
char * data = (char…

Jorhn Madsen
- 129
- 8
3
votes
1 answer
Elasticsearch with Kubernetes: Memory lock with bootstrap.memory_lock does not work
I'm currently struggling with the k8s setup for our used elasticsearch with version 2.4.6:
Disable the memory swapping with bootstrap.memory_lock does not work. Memory reservation is failing with the well known error:
[2020-05-22 21:12:22,762][WARN…

dom
- 732
- 7
- 19
1
vote
1 answer
How to use plock(HPUX) on Linux
I am porting a HP-UX program to Linux. There IS
plock(PROCLOCK);
Should I use mlock() to instead of it?
Also the original code did not call plock(UNLOCK), not sure why, but I should add munlock()?

atu0830
- 405
- 7
- 15
0
votes
1 answer
How do segments from a single memory page behave when mlock'd?
The man page for these system calls state that memory locking and unlocking is preformed in units of whole pages.
Assume that I have called mlock(2) to lock multiple address ranges from a single page of memory. If I call munlock(2) on one of these…

Tenders McChiken
- 1,216
- 13
- 21