Super page size of 1GB and "pinning" to memory

I am writing a Genomics application for MacOS. I would like to allocate large page sizes of 1GB in memory where I store frequently accessed genomics data. Further, I would like these pages to remain resident in memory and not swapped to disc. How do I do this. I have 256GB RAM and not other applications running but mine, so having large blocks of free memory is not an issue.


Can an application request allocation of these large super pages of 1GB and further pin to memory or is this done by a driver?

Posted on Apr 14, 2024 2:32 PM

Reply
1 reply

Apr 14, 2024 5:26 PM in response to rbudruk

There’s not much detail available on this topic.


Linux does GB-sized pages, but macOS AFAIK doesn’t.


Closest macOS mach_vm_allocate info is probably this Darwin test:

https://opensource.apple.com/source/xnu/xnu-2782.1.97/tools/tests/superpages/testsp.c.auto.html


Per Asahi, Apple silicon was also supporting only 16KB, and not larger. (Details: sysctl -a hw machdep.cpu )


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Super page size of 1GB and "pinning" to memory

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.