Skip to content

Instantly share code, notes, and snippets.

@alexalouit
Created April 4, 2022 10:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alexalouit/9d65c90ee022f00a508c66d64ab2505f to your computer and use it in GitHub Desktop.
Save alexalouit/9d65c90ee022f00a508c66d64ab2505f to your computer and use it in GitHub Desktop.
macOS: reduce ram usage
- disable SIP
# boot in recovery mode (Command + R)
# open utilities / terminal
$ csrutil disable
- disable Spotlight indexing
$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
- change swapper default mode
vm_pageout.h:
#define VM_PAGER_DEFAULT 0x1 /* Use default pager. */
#define VM_PAGER_COMPRESSOR_NO_SWAP 0x2 /* In-core compressor only. */
#define VM_PAGER_COMPRESSOR_WITH_SWAP 0x4 /* In-core compressor + swap backend. */
#define VM_PAGER_FREEZER_DEFAULT 0x8 /* Freezer backed by default pager.*/
#define VM_PAGER_FREEZER_COMPRESSOR_NO_SWAP 0x10 /* Freezer backed by in-core compressor only i.e. frozen data remain in-core compressed.*/
#define VM_PAGER_FREEZER_COMPRESSOR_WITH_SWAP 0x20 /* Freezer backed by in-core compressor with swap support too.*/
$ sysctl -a vm.compressor_mode
vm.compressor_mode: 4
$ sudo nvram boot-args="vm_compressor=2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment