Hello again :),
My another customer has contacted me experiencing the same issue. This time we managed to collect what you asked before and here are the results:
Important Usage Capacity:
58950711604 bytes (58.95 GB)
Opportunistic Usage Capacity:
15721119744 bytes (15.72 GB)
Soon we will also have another Feedback Assistant report from that machine.
As I understand the results, they mean that the machine has instant access to ~16GB of free disk space, but in total it's possible to allocate ~59GB. So it doesn't seem like a situation in which the system should aggressively kill apps launched explicitly by the user.
The customer is using Sequoia 15.7.7 (24G720) - so there might be a difference in how the system triggers those clean ups.
I checked cache again and it is used only by 3rd party libraries, CloudKit and URLSession - but nothing spectacular, the size of cache on the customer's machine is below 1MB, and on my machine it's 5MB.
The funny part is, that it turned out that I'm also low on free disk space.
Results from my machine:
Important Usage Capacity:
35198571945 bytes (35.20 GB)
Opportunistic Usage Capacity:
6679613504 bytes (6.68 GB)
and I have never experienced this issue. I even checked the last 28 days against CacheDeleteAppContainerCaches and there is nothing.
I'm starting to suspect that maybe free disk space is just one of the components causing this problem. Maybe also something else matters - like Mac configuration or a specific service running in the background.
I know that I still can go with the solution to auto-relaunch the app, but I keep it for now as the last resort, as I believe there must be something else here. Every single person reporting this issue mentions the same thing - "it only happens with your app".
I also checked launch agents on my machine and none of the apps is registered there and I'm using many menu bar apps. So if the issue was "normal" it would occur also for other apps not being launch agents.
I think it wouldn't be natural for the normal app to be a launch agent with the "keep alive" option. It makes sense for something that really maintains a service, that must be running all the time, but not for the normal UI app.
I'm not expecting the user to be running my app all the time, I'm expecting the app to be running for as long as the user wants it running - to be explicit from the moment the user launches the app to the moment when the user quits the app - the same way the user expects non-menu bar apps to be running.
Right now, I have only two wild guesses on what could be the differentiating factor between my and other apps:
I'm using iCloud synchronization, so maybe it's doing too much work in the background and that's why the system decides to kill my app - this is also using cache.
I'm using Firebase Crashlytics - we were able to notice that it maintains an active session in cache (probably records events that are included in crash reports). However, Firebase is quite popular so it's likely that other apps would have the same problem. I'm also keeping the library up to date.
This bug is probably going to give me nightmares. It's like looking for a needle in a haystack.