While I’m singing the praises of Electron apps, I should also praise the memory efficiency of Catalyst apps, especially Apple’s own. 1.5 GB for a single-window app.
@gruber I don’t know if it’s Electron app or not but Apple Maps Data is listed as taking up 17 gigs of data even though I’ve deleted the app. By any chance do you know how to get rid of this 17 gigs or why it’s persisting even after the app was fully deleted rather than being offloaded?
@gruber The main issue I have with Catalyst apps isn't so much the memory footprint, but that the UX for a lot of them is still pretty bad after a few years, and they often don't feel very at home on the Mac. Looking at you, Home 😡
@gruber Catalyst apps are native apps using native APIs, so whatever News is doing, I don't expect it would use any less with a different technology; it probably has a lot of WebKit going on, to be fair, and whatever you're caching
@stroughtonsmith@gruber Also, having empty memory doesn't speed up your computer. It's there to be used. I wouldn't mind if my browser took up the entirety of memory to cache data as long as it drops it when the rest of the computer needs some. Also, the memory column includes memory shared across programs and can appear to be comically large even though real private mem usage is much lower.
@stroughtonsmith I know it's not the nature of Catalyst in and of itself to leak memory, but I think what happens is that apps written primary for iOS can get away with memory leaks because they get paged out in the background when necessary. They're not written to be running non-stop for days (or even weeks).
@gruber@stroughtonsmith They also end up in compressed memory (essentially paged out) or evicted entirely from memory with only a screenshot of the screen remaining (so you see something in the app switcher).
Most apps are written to take that into account, but on macOS, the model is different and an app's state is much more visible than the app switcher: it would be weird if the News app just randomly disappeared from the Dock, for example.
@chockenberry@gruber@stroughtonsmith If I recall there’s a MacOS thing you can opt into that tries to do a similar thing. Sudden App Termination? Napkin adopted it but it’s been years. There’s a state restoration mechanism too. I think Xcode does that when you shut down your Mac and it is running. You’ll see the window appear on relaunch but it’s a placeholder. The app comes up and takes its place later.
@chockenberry@gruber@stroughtonsmith Totally. I’m not even sure when they trigger that path on macOS anymore. It’s opt-in by the app so the OS holds all the cards on what happens. I’d guess the behaviour across the ecosystem was never good enough to press the idea much further. Catalyst apps could be a good candidate for ramping it up though.
That said if the window is on screen and they don’t restore it’s super weird behaviour. A) they shouldn’t leak. B) macOS contract with apps is lenient.
@stroughtonsmith@chockenberry@gruber That’d make a lot of sense. Maybe the OS can be more aggressive with them. It knows they’re opted in and not AppKit apps. (Caveats apply obviously) So the policy can be a little more aggressive. But who know. Mostly apps shouldn’t leak and killing, even in a cute fashion, isn’t a real fix.
@gruber@stroughtonsmith I think you're mostly right here, except for the use of “paged out in the background”. The actual effect you're looking for would be “terminated in the background”, so that when the app comes back to the front, it's relaunched in a new process—thereby receiving, as we used to joke inside Apple, a fresh set of global variables. Paging back in would give you the old process and memory setup back, leaks and all. Maybe someone on Springboard can come correct me if I'm wrong.
@gruber@stroughtonsmith Back in the pre-Multitasking days (iPhoneOS 3, manual memory management), a fellow iPhone developer told me he never released any memory because he didn't understand it, and his app would only run for short periods of time 😅
@stroughtonsmith@gruber They are certainly not native. Yes a set of builtin apps (like Messages) use that zombie and that is awful.
What system features does it power?
@helge@gruber …how do you personally define native? Because virtually the entire OS is Objective-C/Cocoa, so if you're writing Swift code it's all 'non-native’ 😅 That's a bolt-on runtime with a translation layer and non-native idioms.
If it emits native code, talks to the same system frameworks, and is used to build the system apps, it's ‘native’.
@stroughtonsmith@gruber For me native means that it follows the system UX conventions, UIKit is of course closer to that than say Electron, but it is still quite off. Just like you can easily tell an Electron you can usually tell a Catalyst app (eg via resizing behavior)
What language is being used doesn’t matter that much for me, a PyObjC Cocoa app can be perfectly sound.
An app using a different framework isn’t native 🤷♀️
@helge@gruber a bad app is a bad app; I ain't got no problem with window resizing 😛 The simple fact is you likely have no idea you're using Catalyst apps until you come across a bad one, which is the way it should be. Either way, it’s still native, maybe even Apple’s /preferred/ native solution for system apps, considering it’s taken over a good 30–40% of them in just a few years 😉
@gruber Those memory comparisons are quite off really. There is nothing wrong with apps consuming all the memory available, it’s there, use it.
The key difference is what the memory is being used for, and for Electron that is largely just infra.
@nickfoster It combines for over 100% of a CPU core here for me, idle, too. Texts is a much better behaved app -- lower memory use and nearly zero CPU when idle.
@gruber You should see Google Drive Desktop app. Brutal. And it gets stuck all the time, but Google seem to have no idea why, or how to fix the problem, so the only solution is to delete everything and reinstall. Crazy.
I don't love electron either but the idea that you can't optimize an app's memory usage or helper process footprint with it is a bit silly. Maybe beeper is indeed not good, I haven't tried it, but this is like Gamers™ pointing at a "Unity" splash screen and saying it makes a game bad. You're confusing brand association for technical capability.
@gruber@caseyliss Not weird, it’s handy and often a life saver to have it catch you press the wrong key. Firefox also makes you confirm you’re really sure. I’d consider it weird that Safari hasn’t matched its competition here.
@kirb it defeats the whole point of keyboard shortcuts. I don't use them to get asked 20 questions, i use them exactly NOT to get asked 20 questions. 😄 @gruber@caseyliss
@scottwillsey@gruber@caseyliss I press ⌘W in my browser constantly, I very rarely want ⌘Q, but Q is right next to W where I can accidentally press it and ruin my day. When I really do want it, I can hold it or hit return to confirm. Really not a big deal.
@gruber@caseyliss I think that’s mostly for people like me who never intentionally cmd+Q anything on purpose and sometimes hit that combination by mistake. Wouldn’t be surprised if there’s more of us than people who use cmd+Q intentionally.
@agiletortoise@gruber Yeah… but Command-Q is right next to Command-W and browsers have long restart times, so I have found the similar thing in Firefox to be useful.
@agiletortoise@gruber lol yes I only use chrome on occasion when I’m having an issue that seems potentially browser related. Every time chrome tells me to “hold to quit” I always feel like I’m going to close chrome and then the next app in the queue accidentally.
@mikenichols@agiletortoise@gruber You can just cmd Q twice instead, which I found to be more reliable or at least seemingly safer than holding it (Chromium has the same behavior)
@lm1@agiletortoise@gruber that’s actually what I do, and even that worries me I’m going to accidentally kill the next app in the queue. My muscle memory really doesn’t like that move.
Putting aside the thirstiness of asking for an app to remain running in the background, despite it consuming 1.8 GB of RAM in idle state, "Close" does not mean “Quit" in Mac parlance, and the Cancel button should be on the left.
@gruber Not sure if you used Texts, but it asks for accessibility features to control your screen and then uses that to automatically click a system pop up asking for elevated permissions to see your messages data. I get why they thought that would be more seamless for the user, but it left a bad taste in my mouth.
@gruber I don't even understand why they ask you to first install the desktop client when you try to set up the iOS one. What are they doing in the background?
@gruber Adobe’s Creative Cloud app does something similar when you quit, suggests you leave it running in the background instead (At least it used to. Can’t confirm it still does)
@jblake@gruber@pmcg I’m not here to defend Chrome (I avoid it myself) but I can see the logic in a world where the browser is practically a second operating system. You can have numerous “applications” in it, which may have active state or unsaved user data. An accidental quit of a web browser is potentially a data-loss event. So I think it makes sense in the same way it makes sense to ask if you really wanted to shut down your computer. You might be real sad if it didn’t.
@gruber@dmnelson@jblake I cannot argue because I have never used an iOS device with a keyboard. But on the other hand, I feel like you have been strident in wishing more MacOS "gestures" (as it were) should be on iPad. But not the other way?
Pressing a window up to the top of display for … a while … does enter a new mode on MacOS!
@gruber Ford’s app called Ford Pass for their newer vehicles does something similar on iOS after you quit the app. You immediately get a notification that asks you to keep the app open so that their “phone as a key” feature will work “more reliably.” For the record, the feature doesn’t work reliably whether the app is in the foreground, running in the background, or not running at all.
@gruber don’t be fooled Automattic is all about AI scraping scraping and user profiling despite the gorgeous Trojan horse promise of a unified universal messaging and microblogging platforms. I wouldn’t dare use it for personal or private communications.
@kraigschmidt You might be jesting, but the truth is Apple has banned Electron apps -- on iOS. And that's exactly the sort of protection the DOJ's antitrust complaint argues is abuse of their supposed monopoly.
@gruber@kraigschmidt do you mean Apple has banned apps built using concepts that Electron uses? Because electron is a desktop technology and doesn't target iOS or Android at all...
@gruber@kraigschmidt I think you need further clarification. The only part of Electron-like that Apple doesn't allow is the chromium engine baked into Electron. I've shipped apps on iOS with multiple javascript-in-webkit frameworks...
@eb@gruber@kraigschmidt I think maybe what he's insinuating is that Electron specifically uses Chromium rather than "a webview," and non-webkit engines aren't allowed. I've definitely shipped Cordova apps on iOS, which work the same way but using the WebKit that's already on iOS 🤷
@nyquildotorg@gruber@kraigschmidt ah, that makes sense, it was just confusing to see that statement in the context of 'webapps pretending to be real apps use a lot of resources'
I wasn’t jesting at all. Don’t get me started on the DoJ and DMA. I’m brutally angry.
I want Apple to be more restrictive, not less.
I want the wall of the garden to be higher and stronger.
Apples not perfect, but they care more (which is to say, at all) about the user experience than anyone else, because that’s the business model they’ve chosen.
There are examples everywhere even with their success Apple still can’t persuade companies to do the right things for UX…
Add comment