Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Q]: Can a WM positively affect the responsiveness of a system at low-memory state? #119

Open
GHNewbiee opened this issue May 1, 2024 · 11 comments
Labels
feature New feature or request

Comments

@GHNewbiee
Copy link

When a system runs out of memory it becomes unresponsive for some time which may cause fatal problems.

In kernel space there are already techniques and tools (rlimit, ulimit, cgroups, swapping, OOM-killer, etc) to avoid unresponsiveness or recover the system to an operational state.

I wonder if a WM would play a proactive role to that issue and how.

For example: One way I see that may exist is to give extremely high priority to the "close" order of windows which contributes to the immediate release of used memory (is that feasible)?

Tia

@mattkae
Copy link
Collaborator

mattkae commented May 1, 2024

Interesting thought! What would be the feature here? Would it be something like:

The WM can be configured to kill applications according to some order of priority when the CPU spikes above 90%

@GHNewbiee
Copy link
Author

GHNewbiee commented May 1, 2024

I am not a fun of autokilling applications because if a financial app is auto-killed and money gets lost , user will proceed to auto-self-killiing ! 😉😊

The ideal would be windows never become unresponsive in some smart way so that user can close any window any moment in dt time without delay to recover memory.

The problem exists, it's real . I have faced it many times .

Hence, let's start from the question, "is it possible theoretically and practically a window never becomes unresponsive in user-space?"

@GHNewbiee
Copy link
Author

On the other hand , the idea of closing order would be a step forward .

@GHNewbiee
Copy link
Author

GHNewbiee commented May 1, 2024

Please pay attention that I write about window responsiveness and not application responsiveness.

The application may "freeze" but window controls never do! So, when I decide to closie a window, it sends a "close" signal with highest priority to the application or a "kill" signal. Any pending operation apart from saving eg swapping is halt and closing operation begins .

I.e. a safe memory area in user space is created which holds the window operations separate from applications ones. Something like that .

What do you think ?

@GHNewbiee
Copy link
Author

Windows have 3 buttons minimize, maximize/restore and close.

What about an opfional fourth one kill as a "Skull". This button has to remain active even when the system does not respond at all.

😲😳

@GHNewbiee
Copy link
Author

A kind of an "Emergency Shutdown" switch activated manually by pressing a "skull" button.

@mattkae
Copy link
Collaborator

mattkae commented May 21, 2024

Sorry for getting back so late 😅 A bunch of traveling and a bunch of other mir/miracle related work has taken my attention lately.

However I do understand better what you mean now! The compositor does technically have the ability to force close a window (e.g. by force closing the Wayland socket). I also have run into this same problem when processes like CLion fail to close, and I usually end up having to kill -9 <pid> it to get out of that situation. There might be a better way now that you bring it up...

@GHNewbiee
Copy link
Author

I also have run into this same problem when processes like CLion fail to close, and I usually end up having to kill -9 it to get out of that situation.

If system is frozen, I suspect you cannot even open a console window (terminals switch may work). Only mouse pointer is working sometimes . Hence, click on Skull button should immediately ( in the highest priority) execute the kill -9 <pid> command to release occupied memory and remove cpu load.

@mattkae mattkae added the feature New feature or request label May 21, 2024
@mattkae
Copy link
Collaborator

mattkae commented May 21, 2024

I would also potentially like that feature 😄 Interesting idea. I think it's a good potential "kill switch" feature. It might not manifest itself as a skull button, since many applications only want client-side decorations, but it could be a keybind of some sort that the compositor handles.

@GHNewbiee
Copy link
Author

Common users are not familiar with keybinds . A lot of people use a machine ONLY through a GUI and mouse. They use only what they can see in DE at first or second sight (menu, options , etc). They hate mystical features.

Try to make the features apparent to them through GUI and one-click if possible.

Note: I use pc the last 40 years , I do only know/remember cut/copy,/paste. I have spent for configuring keybinds no more than 2-3 hours in my whole life and I have regretted it. Especially those ones which will be used once a month or 3-6 months.

IMHO , add the Skull button in API. Any app wants only client-side decorations will avoid calling it. It could also be optionally added to windows by users . Just give the freedom to the users to choose to use it or not.

@GHNewbiee
Copy link
Author

It would be possible for the Skull button to automatically appear (a dynamic feature) in windows when used memory and/or cpu load reach preset values defined by user as options .

IMHO , that would be a great feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants