Can be application warmed before lowmemorykiller kills it?
Hi, I am developing map application. It uses in memory cache for map tiles. Bigger cache improves user experience, but my application is first target of lowmemorykiller then. Exist some standard way how application can detect that system under pressure? Application can release majority of its cache in such situation to avoid painful dead.
Only idea that I have is watching /proc/meminfo, but this is not nice solution. I know that kernel developers discussed some mechanism how kernel can notify user space processes that system is in low memory state but no solution was implemented yet. Right?
Could be lmk says " I'm gonna kill something soon" then when it starts killing app " I'm gona kill you"? Anyway we should have this immediate.
alloj ( 2016-05-06 13:07:32 +0300 )editWebOS had it on first palm pre with 256MB of ram. It was giving communicates about not enough ram to open another app and suggested to kill some of actually running. Was annoying in the beggining but I got used to it after some time. Also adding swap file helped a bit.
Mądry ( 2016-05-07 08:04:08 +0300 )editBut I don't want to warm user. I want to lowmemorykiller send some signal (SIGUSR1 for example) to _application_. Application should be smart enough to free its resources...
Karry ( 2016-05-07 09:11:10 +0300 )edit