17 ms·
I just ordered the M1 Max with 64GB RAM because I'm constantly getting the "Your system has run out of application memory." popup while working on Lunar[1] in X
by alin23 5y ago
I just ordered the M1 Max with 64GB RAM because I'm constantly getting the "Your system has run out of application memory." popup while working on Lunar[1] in Xcode.
Every time this happens, Xcode uses about 4GB of RAM (probably because of the monolithic UI storyboard of Lunar) but it should still leave enough memory for my other non-memory hungry apps.
But then I open Activity Monitor and I see WindowServer using ~80GB of memory [2]
The only remedy is either `killall WindowServer` or a full reboot.
I've been using an M1 MacBook Pro and Monterey since the first developer beta but this only became an issue in the last 2 months or so.
[1] https://github.com/alin23/Lunar https://github.com/alin23/Lunar
[2] https://cln.sh/CfEL6u https://cln.sh/CfEL6u
- sbr464 5y agoMaybe try disabling TrueTone? Also, in Accessibility > Display try enabling Reduce transparency.
- ArloL 5y agoBeing serious: Do you have Chrome installed? I have been following this story for a while and nothing seems to be coming out of it: https://chromeisbad.com/ https://chromeisbad.com/ https://bugs.chromium.org/p/chromium/issues/detail?id=1158402 https://bugs.chromium.org/p/chromium/issues/detail?id=115840...
- arthur6667 5y agoI do not use Chrome and my windowserver is using 3GB after a month of uptime. I feel this is not a M1/Apple issue to be honest.
- ffhhj 5y ago> sluggish performance of a 2015 iMac since practically the day we bought it I wish I had found this website when my MacBook Pro was still alive, maybe Chrome actually killed it after all. The low performance was so bad I moved to Windows 10 ("the last Windows system" they said), but after it notified my system can be upgraded to 11 I quickly moved to Ubuntu. I'm currently experiencing a few hiccups and reduced them with some memory tweaks, but still the experience is much better than Mac and Windows.
- SV_BubbleTime 5y agoI’m probably dumb and wrong, but that 80GB is likely virtual memory and not a great indication of actual RAM used.
- alin23 5y agoIt is virtual memory, the real memory size is usually sub 1GB. But I just can’t find any other culprit, and killing WindowServer is the only thing that helps. I have no idea how to troubleshoot this and don’t really have time for it when working on hotfixes, I just want to get back in a state where I’m not facing an imminent system lock up where I can’t even save my recent work.
- MauranKilom 5y agoThis is a windows technique, but presumably something similar might be available on mac too: https://randomascii.wordpress.com/2018/02/11/zombie-processes-are-eating-your-memory/ https://randomascii.wordpress.com/2018/02/11/zombie-processe...
- matthew-wegner 5y agoDo you tint your mouse cursor (new Monterey accessibility setting)? I noticed this in the last handful of developer betas, and it definitely shipped out in 12.0.1: https://bugzilla.mozilla.org/show_bug.cgi?id=1735345 https://bugzilla.mozilla.org/show_bug.cgi?id=1735345 Although that particular issue will show in application footprint, not WindowServer. I see WindowServer buildup on one of my M1s still, even in 12.1 beta :(
- alin23 5y agoNope, never used that setting. I just opened Accessibility and hit reset on the pointer colors again just to be sure.
- saagarjha 5y agoActivity Monitor shows a "memory footprint", rather than just a simple sum of virtual memory usage. Among other things, this number splits memory usage for resources shared across multiple processes (e.g. system libraries) and attributes a fraction to each of them.
- FPGAhacker 5y agoI’ve noticed the high memory usage of WindowServer on my Mac at work. To the point where I have to kill it, which is a pain. This is an intel Mac though. I haven’t seen it on my M1 at home.
- lostlogin 5y agoMy god. I made it down to here in the thread wondering what all these people were doing with Windows Server.
- raihansaputra 5y agoAnother anecdata: My old 2015 8GB MBP also has the same problem; unbearably slow now. The M1 MBA (also 8gb) doesn't have this problem.
- craigc 5y agoI too have the problem with WindowServer although for me it seems to happen with just regular usage. I have not rebooted in 48 days, and currently it is using 10GB RAM (I have a MacBook Air with 16GB). I have seen some people claim it has to do with using a display scaling setting other than the default (I use 1280x800).
- saagarjha 5y agoHow many windows do you have open? 10 GB of RAM is a very large amount for WindowServer to use.
- craigc 5y agoYes, I agree, but it is a memory leak. It doesn’t START at 10GB. Also closing windows does not help much at all. To answer your question, I have a total of 73 windows open at the moment. 11 of them are from applications with a single window open, 8 are from iTerm, and 54 are from Sublime Text. I am aware that is quite a lot for Sublime, but that is just how I use it. Regardless, I just quit Sublime Text, and the memory usage only dropped to 8.9GB still absurdly high for having 19 windows open.
- saagarjha 5y agoYes, it is. Can you try running this and seeing what it reports: https://news.ycombinator.com/item?id=29147886 https://news.ycombinator.com/item?id=29147886?
- craigc 5y agoThanks. Output is here if you have any ideas. https://gist.github.com/ccampbell/9a0118b0e3e607ec56a3a2cc59afc3b0 https://gist.github.com/ccampbell/9a0118b0e3e607ec56a3a2cc59...
- saagarjha 5y agoHmm, that is interesting. You have lots of unaccounted for memory, which is not normal at all. Would you happen to have the full footprint output? Trying to see how the 200K individual VM_ALLOCATE regions are distributed in side.
- cbovis 5y agoGreat to see you pop up on HN. I discovered Lunar a couple of weeks ago after wondering whether something like it existed and it's been a great tool so far. Solves one thing and solves it well. Keep up the great work!
- alin23 5y agoThank you for the kind words! I’m always happy to see that the hard work that goes into this app is appreciated and useful.
- R0b0t1 5y agoWhere do you see the 64GB option?
- BiteCode_dev 5y agoThat's what I find amazing with Apple users. They sell you a very expensive machine that doesn't work. Your reaction? Buy a more expensive one from the same provider!
- rimliu 5y agoYour mistake is thinking that that machine "doesn't work". It obviously works for them.
- valparaiso 5y agoMacBooks are default working stations for developers over the world for the past ten years and judging by one example is nothing more that Apple-hate.
- wffurr 5y agoWhat other machine can you buy to run Xcode on? Also, I get along just fine with the last few Macs I have had...
- papito 5y agoHow about the Mac Mini?
- Fnoord 5y agoOr Hackintosh. Hey, GP asked 'what machine'. Didn't require it to be an Apple.
- jiux 5y agoI’ve given this thought for an older MBP of mine that can’t upgrade to latest OS so that it can be used as a CI. My issue with that is 1. Can I trust the hackintosh to not be compromised and 2. Uploading an IPA via hackintosh feels like bananas.
- 5y ago
- mlindner 5y agoCall Apple support as your experience is different than other people's. No memory problems here at all.
- saagarjha 5y agoApple support is generally not going to be able to help you solve software bugs.
- dschuler 5y agoI've had similar problems.. See my sibling comment, there's a chance it may be helpful!
- saagarjha 5y agoNext time it happens, can you try running heap(1) against it? It might help point out where that memory is going.
- alin23 5y agoJust happened again [0] and no amount of app killing helps. I ran heap(1) on WindowServer [1] but there's nothing in there standing out so maybe this is a red herring. [0] https://cln.sh/A7YPLN https://cln.sh/A7YPLN [1] https://gist.github.com/772687dba65a35cca8cd707fcfda99c0 https://gist.github.com/772687dba65a35cca8cd707fcfda99c0
- saagarjha 5y agoNot a red herring, just confirming it wasn't a normal application memory leak (it's not, the malloc usage is fine–I think you're hitting the same issue as is mentioned in this article). The next step I would do is run sudo footprint $(pgrep WindowServer), optionally with -v to give you a really detailed list of why the footprint is so high.
- deleted 5y ago[deleted]
- doctor_eval 5y agoOff topic but I love Lunar. Thanks!
- weatherlight 5y agoI switch over to safari for the time being and no issues.