macOS High Memory Usage

  1. last week

    Graham B

    Dec 6 Pre-Release Testers, Xojo Pro The Canada's

    Using 2017r2.1 i compiled a 64bit app with nothing in it, just the window, and ran it.
    Starting memory 15megs. I then resized to 5K screen size. Memory jumps to 120megs. Resize back to starting size ~25 megs, resizing back up to full screen i see 220megs being used. Close the window (leaving the app running) it sits at 112 megs.

    Same app on Surface pro 4, windows 10, app uses 7 megs.

    Both have hiDPI support on.

    Any idea on why empty window is using so much memory on macOS?

    I am running OSX 10.12.6

    Caching, IMHO. Modern macOS like to cache everything and anything, hold onto it until the very last moment. Right now Apple uses Triple buffering, each control has a display cache, each window has a display cache and of course each screen has a display cache.

  2. Sam R

    Dec 6 Pre-Release Testers, Xojo Pro Answer Hengchun, Pingtung, Taiwan

    Caching, IMHO. Modern macOS like to cache everything and anything, hold onto it until the very last moment. Right now Apple uses Triple buffering, each control has a display cache, each window has a display cache and of course each screen has a display cache.

  3. Graham B

    Dec 6 Pre-Release Testers, Xojo Pro The Canada's

    Looks like your right there, just tried it with a text editor app and resizing window effects memory usage a lot.
    Good to know.

  4. Sam R

    Dec 6 Pre-Release Testers, Xojo Pro Hengchun, Pingtung, Taiwan

    Most of time it doesn't cause any issues, although if your installation of the macOS is borked somehow (mine was), the machine can crash when exceeding the physical amount of memory (which happens a lot for me).

  5. Sam R

    Dec 6 Pre-Release Testers, Xojo Pro Hengchun, Pingtung, Taiwan

    I forgot to add that if you use Apple's imaging API the images are 'sorta' cached into memory too. I say sorta, because it caches the image at the display size in memory, but when you want to draw it at a different size, it re-reads from disk, creates a cache that size and stores that in memory.

  6. Mathias M

    is not verified Dec 7 Pre-Release Testers Bruges, Belgium

    @Sam R Most of time it doesn't cause any issues, although if your installation of the macOS is borked somehow (mine was), the machine can crash when exceeding the physical amount of memory (which happens a lot for me).

    That's odd. OSX (and all OS's for that matter) should start swapping if more memory is used than physically available. Not crash.

  7. Sam R

    Dec 7 Pre-Release Testers, Xojo Pro Hengchun, Pingtung, Taiwan

    @Mathias M That's odd. OSX (and all OS's for that matter) should start swapping if more memory is used than physically available. Not crash.

    Oh trust me, when it's swapping you can really feel it. Yeah it shouldn't crash, but it used to until I did a clean install. Now it just chuggs when I over reach, just t'other day I was using over 64GB (AutoRelease issue not releasing while a thread is running).

or Sign Up to reply!