aui
aui copied to clipboard
Handle low memory event
Describe the need of your project
Modern OSes provide a way to handle high memory pressure. We'd like to handle such event. Also, it would be useful if AUI would print this signal emission to logs by default. AUI has several caches for textures, sounds, etc... so they can subscribe to this signal as well.
Proposed solution
Make global AObject like ASharedApplication with signal lowMemoryNotified. The underlying implementations:
- Windows: CreateMemoryResourceNotification
- Linux: /sys/fs/cgroup/memory/memory.pressure_level fd
- macOS: simulating low memory condition
- Android: onTrimMemory, onLowMemory
- iOS: UIKit didReceiveMemoryWarning
Alternatives you've considered
No response
Additional context
No response