Re:Replacing a $3000/mo Heroku bill with a $55/mo server
by dwattttt on Wednesday October 22, 2025 @06:55AM
(#45667278)
If you're getting this far into the details of your memory usage, shouldn't you use mlock to actually lock in the parts of memory you need to stay there? Then you get to have three tiers of priority: pages you never want swapped, cache, then pages that haven't been used recently.
[ Parent
| on HN ]
Re:Replacing a $3000/mo Heroku bill with a $55/mo server
by pdimitar on Wednesday October 22, 2025 @09:49AM
(#45669131)
Can mlock be instructed to f.ex. "never swap pages from this pid"?
Re:Replacing a $3000/mo Heroku bill with a $55/mo server
by bayindirh on Wednesday October 22, 2025 @09:51AM
(#45669173)
The application requests this itself from the Kernel. See https://man7.org/linux/man-pages/man2/mlock.2.html
Re:Replacing a $3000/mo Heroku bill with a $55/mo server
by dwattttt on Wednesday October 22, 2025 @04:47PM
(#45674932)
From the link, mlockall with MCL_CURRENT | MCL_FUTURE
> Lock all pages which are currently mapped into the address space of the process.
> Lock all pages which will become mapped into the address space of the process in the future.