Registered Member
|
In the last time, there has been a lot of talking about memory pressure and Linux system unresponsibility when it comes to it.
In my experience memory, pressure problems always happen because I forget to close some large program (ex. a virtual machine when I do testing) and then start some additional programs. What I wish for is a simple plasmoid, that would pop an alert message when my memory is let's say 90% full. This could also be applied to the existing "Memory usage" plasmoid. Simply add a checkbox and an input field indicating the percent of memory being used and pop an alert when threshold is being exceeded. by TheR |
Registered Member
|
Hi!
This won't help as unsued memory is needless. Memory has to be "full" to not read everything again and again from slow devices. So if memory is > 90% "full", the system just works fine. If the system goes low on memory it starts swapping (if a swapfile / swap partition is enabled). Perhaps you can track this behaviour. After swap is full it starts killing "unneeded processes" which basically means to kill all user processes (GUI etc.) as they are not needed to run the system and so prevents crashing the whole. |
Registered Member
|
The message would be for the dummy behind the keyboard, to close some unused programs before mayhem will happen
by TheR |
Registered Member
|
Sure. But the simple memory usage won't help if there is a swap. I suggest using a script running in the background and performing the check before the out-of-memory-killer begins killing processes. See this script for an example. The notify send command will create a warning in your notification area which is just fine. One could adjust it to use `notify-send -u critical` to have a sticky notification. It does need only small resources and does work. A plasmoid would just take a lot of memory itself to display stuff and at least just throw a notification itself.
Another way would be changing the behaviour of the oom-killer itself or to "select" the processes by priorizing them. As an example, I want my current browser to be killed late, I can do the following requiring root permissions
To put all together, your "tiny" plasmoid needs to check the availabilty of memory, swap, all user processes (as there could be heavy load processes running in another scope), the order of the process kill list, etc. just to warn you before your system starts to kill processes and to make sure the warning tool is not the first one being killed As killing processes is the last thing before a crash, you should analyze the usage and why it does begin to kill processes. Fight the disease, not the symptoms. You can use the plasma-systemmonitor to get an overview of your processes consuming to much memory (rightclick to attach the memory monitor as a plasmoid on the desktop). The default behaiour of process killing has good default settings and tinkering may result in a full unusable and crashed system, so perhaps we should investigate the underlying issue itself. |
Registered users: Bing [Bot], Evergrowing, Google [Bot]