-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
library: Add Memory Monitor entry #508
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one!
* library: Add Memory Monitor entry * Update main.json * Update main.blp * Memory Monitor: Suggestions
// Processes should free up unneeded resources | ||
console.log("Warning Level: Low"); | ||
drop_caches(); | ||
} else if (level >= Gio.MemoryMonitorWarningLevel.MEDIUM) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example is great overall! One comment: this should perhaps be a separate if
rather than an else if
, otherwise drop_caches()
will only be called on levels between LOW
and MEDIUM
, rather than on all levels >= LOW
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually wait, now that I think about it, won't it behave in a completely oppositive manner? For all levels >= LOW
, the first if
condition would always be satisfied and it would never get to the other else if
(s) even if level >= MEDIUM
. I can't believe I missed this but still changing the else if
to if
should fix the issue regardless.
* library: Add Memory Monitor entry * Update main.json * Update main.blp * Memory Monitor: Suggestions
Closes #455