2

I regularly receive the "your system has run out of application memory" alert, then the dialog box pops up to quickly kill any offending application before the OS crashes.

However, unlike many of the questions I could read here, my issue isn't with excessive swap usage, but rather than no swap is being used despite memory pressure being very high, a similar case to this one, although on an older OS the difference much higher memory pressure (Here in the yellow, but sometimes reaching in the red). Memory pressure

Now for the context: Following a hard crash after the SATA cable broke (an infamous problem on the 2012 13" MBP), I put the SSD in an USB 3 enclosure and currently running the OS from the externally-connected SSD. Free space isn't an issue as there's close to 200GiB unused. There was no other change in configuration.

With the SSD connected on the internal SATA, I have to deal with excessive swap usage. With the SSD connected externally, no swap is being used at all even when the system runs out of memory.

Of course Microsoft Teams is a memory hog given how idle it sits, but that doesn't explain why Mojave wouldn't do its thing and start using swap when it becomes really necessary to prevent a crash.

EDIT Answers to some questions below: @Gilby

Checked that: I've checked vm.compressor_mode:

sysctl -a vm.compressor_mode vm.compressor_mode: 4

sysctl vm.swapusage vm.swapusage: total = 0.00M used = 0.00M free = 0.00M (encrypted)

Result for mount command: mount

/dev/disk2s1 on / (apfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
/dev/disk1s1 on /Volumes/Sª Catalina (apfs, local, nodev, nosuid, journaled, noowners)
/dev/disk1s2 on /Volumes/Sª Catalina - Datos (apfs, local, nodev, nosuid, journaled, noowners)

Result for diskutil list command: In fact, there's a VM:

/dev/disk0 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.0 TB     disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk1         120.0 GB   disk0s2
   3:                 Apple_APFS Container disk2         879.7 GB   disk0s3

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +120.0 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Sª Catalina             11.3 GB    disk1s1
   2:                APFS Volume Sª Catalina - Datos     30.7 GB    disk1s2
   3:                APFS Volume Preboot                 25.9 MB    disk1s3
   4:                APFS Volume Recovery                527.5 MB   disk1s4
   5:                APFS Volume VM                      1.1 GB     disk1s5

/dev/disk2 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +879.7 GB   disk2
                                 Physical Store disk0s3
   1:                APFS Volume Mojave HD               699.6 GB   disk2s1
   2:                APFS Volume Preboot                 22.1 MB    disk2s2
   3:                APFS Volume Recovery                508.9 MB   disk2s3
   4:                APFS Volume VM                      1.1 GB     disk2s4

What does it means?

4
  • 1
    I remember reading somewhere that things like LiveCDs and USBs don’t use swap space between its r/w performance is too slow. Is the flash drive you’re using USB 2 or 3?
    – Allan
    Commented Apr 6 at 17:12
  • You might also want to try stress-ng. It can stress test memory which should force use of swap
    – Allan
    Commented Apr 6 at 17:17
  • I suspect, something in your move from internal to external has disabled swap. Does diskutil list show a VM volume? Does mount show a VM volume? What do you get with the commands in the linked question? You need someone with a Mojave system to assist diagnosis.
    – Gilby
    Commented Apr 6 at 22:44
  • @Gilby this comment should be promoted as an answer. As soon as I returned the SSD to its place, swap use resumed.
    – P. N.
    Commented May 27 at 17:46

1 Answer 1

-3

Swap was a thing when RAM memory was limited. Nobody should swap, these days, if the device you want to swap to is an external drive, expect extremely slow system performance.

I notice Firefox using a lot of memory, unsure why, I would advise to use your computer within its limits, it is 12 years old.

If you really want the user experience of a computer six years older than yours, you could try this:

sudo mkdir /Volumes/Swap/s
sudo chmod 755 /Volumes/Swap/s
sudo sysctl vm.swapfileprefix=/Volumes/Swap/s

You will have to adapt Swap to the name of your external drive, and you may change s to the name you would like for your swap device.

I really have to discourage this, though... your RAM is soldered to the board, so 1980's practice...

1
  • I don't even know what you're referring to. Your first statement doesn't make any sense at all. As is your last. And doesn't answer the question at all.
    – P. N.
    Commented Apr 20 at 13:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .