-
Notifications
You must be signed in to change notification settings - Fork 21
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
Rewrite mlockall logic? #22
Comments
I've moved the first one to a separate issue. The second suggestion, I'm not sure I understand it. Rewritten slightly, this is the gist of your suggestion: from ctypes import CDLL
CDLL('libc.so.6', use_errno=True).mlockall(3) While this is roughly the logic as it is in the code today: from ctypes import cdll
cdll.LoadLibrary('libc.so.6').mlockall(3) both approaches seems to work both under python2 and python3. Both yields 0 for me when I run it as root, and -1 when I run it as an ordinary user. |
mlockall(3) is not good in Fedora 29, for example: the daemon will use more then 200 MiB VmRSS with mlockall(3). We should use mlockall(MCL_CURRENT | MCL_FUTURE | MCL_ONFAULT). MCL_ONFAULT appeared in Linux 4.4. |
MCL_ONFAULT reduces memory usage on modern systems. |
status with MCL_ONFAULT on Debian 9:
Without MCL_ONFAULT:
|
thrash-protect's VmRSS on Fedora 29: 222 MiB! Using MCL_ONFAULT fixes the problem. |
IMHO thrash-protect can be optimized to use only 10-12 MiB RSS. |
Is this sufficient? |
Excellent, thanks. |
Use
/dev/shm
instead of/tmp
./dev/shm
always usestmpfs
.Use mlockall() (works with python3):
The text was updated successfully, but these errors were encountered: