D17217: Implement free memory notifier

2020-02-13 Thread Oleg Solovyov
McPain added a comment.


  In D17217#412961 , @davidedmundson 
wrote:
  
  > > It would just be nice not to have to think about this stuff
  >
  > There is an OOM killer. That OOM killer is faster than a human, has access 
to more info about processes and has higher privileges than userspace.
  
  
  (necroposting)
  Which usually freezes my PC for 10 seconds or even more

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg
Cc: rooty, davidedmundson, graesslin, abetts, ngraham, plasma-devel, Orage, 
LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, 
ragreen, ZrenBot, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, 
sebas, apol, ahiemstra, mart


D17217: Implement free memory notifier

2019-02-15 Thread David Edmundson
davidedmundson added a comment.


  > It would just be nice not to have to think about this stuff
  
  Well that's the point. 
  You're only going to run out of memory on a working system if you have a 
runaway process. There is an OOM killer. That OOM killer is faster than a 
human, has access to more info about processes and has higher privileges than 
userspace.

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg
Cc: rooty, davidedmundson, graesslin, abetts, ngraham, plasma-devel, jraleigh, 
GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, sebas, 
apol, mart


D17217: Implement free memory notifier

2019-02-15 Thread Krešimir Čohar
rooty added a comment.


  In D17217#412918 , @ngraham wrote:
  
  > If it's not enabled by default like the free space notifier is, I'm okay 
with shipping this.
  
  
  I totally agree, it shouldn't be enabled by default

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg
Cc: rooty, davidedmundson, graesslin, abetts, ngraham, plasma-devel, jraleigh, 
GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, sebas, 
apol, mart


D17217: Implement free memory notifier

2019-02-15 Thread Nathaniel Graham
ngraham resigned from this revision.
ngraham added a comment.


  If it's not enabled by default like the free space notifier is, I'm okay with 
shipping this.

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg
Cc: rooty, davidedmundson, graesslin, abetts, ngraham, plasma-devel, jraleigh, 
GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, sebas, 
apol, mart


D17217: Implement free memory notifier

2019-02-15 Thread Krešimir Čohar
rooty added a comment.


  Let me just say that I realize that this is pretty niche, but I would find it 
extremely useful and a lot of thought and care seem to have gone into this, 
hence +1.
  
  In D17217#412888 , @ngraham wrote:
  
  > In D17217#412463 , @rooty wrote:
  >
  > > have OOM problems
  >
  >
  >
  >
  > In D17217#412463 , @rooty wrote:
  >
  > > dislike swap space
  >
  >
  > Erm, I think I may have found your problem. :)
  
  
  Different strokes.
  
  Other reasons too, including the fact that most users nowadays have so much 
RAM that swap can be done away (if you don't use sleep/hibernate that is? I 
don't know how that works though).
  It would just be nice not to have to think about this stuff and have my 
computer help me out.
  
  > I still think this should be something that we don't ship or have on by 
default. It seems to be catering to extremely niche, nerdy use cases. Not that 
there's anything wrong with this! But these kinds of messages about the 
internal state of the system are not appropriate to show a to more casual 
users, who rightfully expect the system to take care of things like this by 
itself.
  
  I'm not suggesting it be shipped as a default setting, and I'd be okay with 
downloading it from the KDE Store, but we do already have niche widgets in 
Plasma (Binary Clock? Fuzzy Clock? Comic Strip, Color Picker...), so I don't 
think that's a reason not to include it. 
  The niche thing doesn't seem like a good reason either - Hard Disk usage, 
Hard Disk IO monitor etc. can all seem niche depending on your point of view. 
And we have tons of those.

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg, ngraham
Cc: rooty, davidedmundson, graesslin, abetts, ngraham, plasma-devel, jraleigh, 
GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, sebas, 
apol, mart


D17217: Implement free memory notifier

2019-02-15 Thread Nathaniel Graham
ngraham added a comment.


  In D17217#412463 , @rooty wrote:
  
  > have OOM problems
  
  
  
  
  In D17217#412463 , @rooty wrote:
  
  > dislike swap space
  
  
  Erm, I think I may have found your problem. :)
  
  I still think this should be something that we don't ship or have on by 
default. It seems to be catering to extremely niche, nerdy use cases. Not that 
there's anything wrong with this! But these kinds of messages about the 
internal state of the system are not appropriate to show a to more casual 
users, who rightfully expect the system to take care of things like this by 
itself.

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg, ngraham
Cc: rooty, davidedmundson, graesslin, abetts, ngraham, plasma-devel, jraleigh, 
GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, sebas, 
apol, mart


D17217: Implement free memory notifier

2019-02-14 Thread Krešimir Čohar
rooty added a comment.


  My two cents - I really like this idea and  this would be a **very** useful 
feature for those of us that really dislike swap space and have OOM problems 
(one too many browser tabs). But I'd set the intervals at 5-10 or even 20 
minutes (not seconds).
  
  Also, I suggest renaming it to "Memory Limit" or something else (a better 
description).
  
  Otherwise, nice work!

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg, ngraham
Cc: rooty, davidedmundson, graesslin, abetts, ngraham, plasma-devel, jraleigh, 
GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, sebas, 
apol, mart


D17217: Implement free memory notifier

2019-01-21 Thread Oleg Solovyov
McPain added a comment.


  In D17217#378768 , @davidedmundson 
wrote:
  
  > > Thanks. Any examples in KDE? I can't implement this from scratch right 
now.
  >
  > There is not, it would requires writing new C code.
  >  It's something I can help with.
  
  
  What/where I can start with?

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg, ngraham
Cc: davidedmundson, graesslin, abetts, ngraham, plasma-devel, jraleigh, GB_2, 
ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, sebas, apol, 
mart


D17217: Implement free memory notifier

2018-12-18 Thread David Edmundson
davidedmundson added a comment.


  > Thanks. Any examples in KDE? I can't implement this from scratch right now.
  
  There is not, it would requires writing new C code.
  It's something I can help with.

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg, ngraham
Cc: davidedmundson, graesslin, abetts, ngraham, plasma-devel, GB_2, ragreen, 
Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, sebas, apol, mart


D17217: Implement free memory notifier

2018-12-18 Thread Oleg Solovyov
McPain added a comment.


  Anybody?

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg, ngraham
Cc: davidedmundson, graesslin, abetts, ngraham, plasma-devel, GB_2, ragreen, 
Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, sebas, apol, mart


D17217: Implement free memory notifier

2018-12-05 Thread Oleg Solovyov
McPain updated this revision to Diff 46892.
McPain added a comment.


  Default limit: 25% -> 10%
  Fix typos
  Auto detect swap, removed "includeSwap" setting
  KSysGuard: show kill button (implemented in D17366 
)

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D17217?vs=46407=46892

REVISION DETAIL
  https://phabricator.kde.org/D17217

AFFECTED FILES
  plasma-workspace/CMakeLists.txt
  plasma-workspace/freememorynotifier/CMakeLists.txt
  plasma-workspace/freememorynotifier/COPYING
  plasma-workspace/freememorynotifier/Messages.sh
  plasma-workspace/freememorynotifier/README
  plasma-workspace/freememorynotifier/freememorynotifier.cpp
  plasma-workspace/freememorynotifier/freememorynotifier.desktop
  plasma-workspace/freememorynotifier/freememorynotifier.h
  plasma-workspace/freememorynotifier/freememorynotifier.kcfg
  plasma-workspace/freememorynotifier/freememorynotifier.notifyrc
  plasma-workspace/freememorynotifier/freememorynotifier_prefs_base.ui
  plasma-workspace/freememorynotifier/kcm_freememorynotifier.cpp
  plasma-workspace/freememorynotifier/kcm_freememorynotifier.desktop
  plasma-workspace/freememorynotifier/kcm_freememorynotifier.h
  plasma-workspace/freememorynotifier/module.cpp
  plasma-workspace/freememorynotifier/module.h
  plasma-workspace/freememorynotifier/org.kde.FreeMemoryNotifier.xml
  plasma-workspace/freememorynotifier/settings.kcfgc
  plasma-workspace/systemmonitor/ksystemactivitydialog.cpp
  plasma-workspace/systemmonitor/ksystemactivitydialog.h
  plasma-workspace/systemmonitor/main.cpp

To: McPain, broulik, #vdg, ngraham
Cc: davidedmundson, graesslin, abetts, ngraham, plasma-devel, ragreen, Pitel, 
ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, sebas, apol, mart


D17217: Implement free memory notifier

2018-12-05 Thread Oleg Solovyov
McPain added a comment.


  In D17217#367842 , @davidedmundson 
wrote:
  
  > There's also an alternative that I'd like to suggest:
  >  According to https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt 
there's a system called "memory pressure" you can watch for events on a 
specific FD with various levels of out-of-memory-ness. A lot cheaper than 
polling, far more reliable, and following the system's OOM configuration. 
Getting that in at a frameworks level so it can be hooked up to notifications 
in this case, but also garbage collections in UI code could be pretty cool.
  
  
  Thanks. Any examples in KDE? I can't implement this from scratch right now.

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg, ngraham
Cc: davidedmundson, graesslin, abetts, ngraham, plasma-devel, ragreen, Pitel, 
ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, sebas, apol, mart


D17217: Implement free memory notifier

2018-11-28 Thread David Edmundson
davidedmundson added a comment.


  Given there is some negativity in the feedback I do want to point out that 
it's cool to still upload whatever to the KDE store/wider ecosystem. Not 
everything run in plasma needs to be from plasma; we go to great lengths to 
make sure that's the case.
  
  There's also an alternative that I'd like to suggest:
  According to https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt 
there's a system called "memory pressure" you can watch for events on a 
specific FD with various levels of out-of-memory-ness. A lot cheaper than 
polling, far more reliable, and following the system's OOM configuration. 
Getting that in at a frameworks level so it can be hooked up to notifications 
in this case, but also garbage collections in UI code could be pretty cool.

INLINE COMMENTS

> freememorynotifier.cpp:55
> +connect(, ::timeout, this, 
> ::checkFreeMemory);
> +timer.start(1000 * 5 /* 1 minute */);
> +}

how is that 1 minute?

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg, ngraham
Cc: davidedmundson, graesslin, abetts, ngraham, plasma-devel, ragreen, Pitel, 
ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, sebas, apol, mart


D17217: Implement free memory notifier

2018-11-28 Thread Nathaniel Graham
ngraham added a comment.


  In D17217#367643 , @graesslin 
wrote:
  
  > I don't think that this is useful - sorry. I run out of memory about once 
every five years, so polling every five seconds is way too often and a waste of 
resources. On the other hand the time when it happens polling 5 sec is way too 
low as then we are already dead. This can only happen if an application eats 
memory and then it's going fast.
  
  
  Agreed.

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg
Cc: graesslin, abetts, ngraham, plasma-devel, ragreen, Pitel, ZrenBot, 
lesliezhai, ali-mohamed, jensreuterberg, sebas, apol, mart


D17217: Implement free memory notifier

2018-11-28 Thread Martin Flöser
graesslin added a comment.


  I don't think that this is useful - sorry. I run out of memory about once 
every five years, so polling every five seconds is way too often and a waste of 
resources. On the other hand the time when it happens polling 5 sec is way too 
low as then we are already dead. This can only happen if an application eats 
memory and then it's going fast.

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg
Cc: graesslin, abetts, ngraham, plasma-devel, ragreen, Pitel, ZrenBot, 
lesliezhai, ali-mohamed, jensreuterberg, sebas, apol, mart


D17217: Implement free memory notifier

2018-11-28 Thread Nathaniel Graham
ngraham added a comment.


  In D17217#367544 , @McPain wrote:
  
  > Sometimes I see what happens if you're running out of memory and oom can't 
do anything - the whole system halts and only solution for this is hard reset 
with all unsaved data lost.
  >  25% is not hardcoded value, **you can reduce threshold down to 1%** and 
also **you can include your swap space in settings.**
  
  
  The problem is that none of this is appropriate to expose regular users to. 
If this feature goes in, it needs //perfect// defaults, because 99.99% of users 
will never change the defaults even if they are annoyed by them.
  
  I would recommend changing the default threshold from 25% to 10%, and 
automatically detect swap space rather than making the user configure it.

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg
Cc: abetts, ngraham, plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, 
ali-mohamed, jensreuterberg, sebas, apol, mart


D17217: Implement free memory notifier

2018-11-28 Thread Oleg Solovyov
McPain added a comment.


  In D17217#367545 , @abetts wrote:
  
  > Is having this feature an optional feature? Can it be turned off?
  
  
  I'll make the notification "disableable" tomorrow

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg
Cc: abetts, ngraham, plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, 
ali-mohamed, jensreuterberg, sebas, apol, mart


D17217: Implement free memory notifier

2018-11-28 Thread Andres Betts
abetts added a comment.


  Is having this feature an optional feature? Can it be turned off?

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg
Cc: abetts, ngraham, plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, 
ali-mohamed, jensreuterberg, sebas, apol, mart


D17217: Implement free memory notifier

2018-11-28 Thread Oleg Solovyov
McPain added a comment.


  In D17217#367525 , @ngraham wrote:
  
  > Thanks for all the work!
  >
  > ...But is this actually useful or actionable for the majority of users? 
Free space is a fairly understandable concept: if you run out, you need to 
delete things to make more room before you can add more stuff. It won't fix 
itself unless the user does something. But memory pressure requires a much 
greater technical understanding and isn't subject to the same conditions. When 
the system is using up 75% of the available memory, there isn't necessarily a 
problem at all. Apps will move to swap automatically. Even if there is a 
problem, it's only temporary, and it may fix itself if the user does nothing as 
the system shuffles things around.
  >
  > I worry that this notifier would just be yet another annoying pop-up that 
people dismiss because they don't understand it.
  
  
  Sometimes I see what happens if you're running out of memory and oom can't do 
anything - the whole system halts and only solution for this is hard reset with 
all unsaved data lost.
  25% is not hardcoded value, you can reduce threshold down to 1% and also you 
can include your swap space in settings.

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg
Cc: ngraham, plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, 
jensreuterberg, abetts, sebas, apol, mart


D17217: Implement free memory notifier

2018-11-28 Thread Nathaniel Graham
ngraham added a reviewer: VDG.
ngraham added a comment.


  Thanks for all the work!
  
  ...But is this actually useful or actionable for the majority of users? Free 
space is a fairly understandable concept: if you run out, you need to delete 
things to make more room before you can add more stuff. It won't fix itself 
unless the user does something. But memory pressure requires a much greater 
technical understanding and isn't subject to the same conditions. When the 
system is using up 75% of the available memory, there isn't necessarily a 
problem at all. Apps will move to swap automatically. Even if there is a 
problem, it's only temporary, and it may fix itself if the user does nothing as 
the system shuffles things around.
  
  I worry that this notifier would just be yet another annoying pop-up that 
people dismiss because they don't understand it.

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D17217

To: McPain, broulik, #vdg
Cc: ngraham, plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, 
jensreuterberg, abetts, sebas, apol, mart


D17217: Implement free memory notifier

2018-11-28 Thread Oleg Solovyov
McPain created this revision.
McPain added a reviewer: broulik.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
McPain requested review of this revision.

REVISION SUMMARY
  FreeMemoryNotifier will warn when free RAM is running out.
  By default, it is 25% without swap space.
  
  Like freespacenotifier, it will check every 5 seconds for amount of free 
memory and
  warn every time when it drops below limit and when free space amount drops 
more than half of previous value
  
  User can either kill most greedy process immediately or open a task manager 
to kill unneeded processes manually.
  Task manager was patched to ignore global config and show only user own 
processes, sorted by memory used in descending order.
  
  The settings are available at new KCM located in Desktop Behavior category.
  KCM and KDED modules are linked through DBus - committed settings are applied 
immediately.

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D17217

AFFECTED FILES
  plasma-workspace/CMakeLists.txt
  plasma-workspace/freememorynotifier/CMakeLists.txt
  plasma-workspace/freememorynotifier/COPYING
  plasma-workspace/freememorynotifier/Messages.sh
  plasma-workspace/freememorynotifier/README
  plasma-workspace/freememorynotifier/freememorynotifier.cpp
  plasma-workspace/freememorynotifier/freememorynotifier.desktop
  plasma-workspace/freememorynotifier/freememorynotifier.h
  plasma-workspace/freememorynotifier/freememorynotifier.kcfg
  plasma-workspace/freememorynotifier/freememorynotifier.notifyrc
  plasma-workspace/freememorynotifier/freememorynotifier_prefs_base.ui
  plasma-workspace/freememorynotifier/kcm_freememorynotifier.cpp
  plasma-workspace/freememorynotifier/kcm_freememorynotifier.desktop
  plasma-workspace/freememorynotifier/kcm_freememorynotifier.h
  plasma-workspace/freememorynotifier/module.cpp
  plasma-workspace/freememorynotifier/module.h
  plasma-workspace/freememorynotifier/org.kde.FreeMemoryNotifier.xml
  plasma-workspace/freememorynotifier/settings.kcfgc
  plasma-workspace/systemmonitor/ksystemactivitydialog.cpp
  plasma-workspace/systemmonitor/ksystemactivitydialog.h
  plasma-workspace/systemmonitor/main.cpp

To: McPain, broulik
Cc: plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, 
jensreuterberg, abetts, sebas, apol, mart