3 ms·
There needs to be a signal apps can be sent when resources are low... there are quite a few apps that could do things like empty various caches under ram pressu
by stuaxo 8y ago
There needs to be a signal apps can be sent when resources are low... there are quite a few apps that could do things like empty various caches under ram pressure for instance.
Similarly for disk space being low, or under IO pressure, some apps could hold off checking certain files / throttle things for a while.
- voidlogic 8y agoThis is a good point, in Go all instances of sync.Pool (Go's generic object pool with thread local storage) are registered with the allocator/GC so that under heap pressure they can be drained, it would be great if the OS could request this draining too.
- skyde 8y agoOn android this Is done using LRU cache for background app. If your app has a cached process and it retains memory that it currently does not need, then your app—even while the user is not using it— affects the system's overall performance. As the system runs low on memory, it kills processes in the LRU cache beginning with the process least recently used. The system also accounts for processes that hold onto the most memory and can terminate them to free up RAM.
- JdeBP 8y agoThis has been invented long since. On AIX it is SIGDANGER.
- stevekemp 8y agoThis might become useful in the future: https://lwn.net/SubscriberLink/759781/1ebdd9d9518b8f14/ https://lwn.net/SubscriberLink/759781/1ebdd9d9518b8f14/