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

library: Add Memory Monitor entry #508

Merged
merged 4 commits into from
Aug 19, 2023
Merged

Conversation

AkshayWarrier
Copy link
Contributor

Closes #455

Copy link
Contributor

@andyholmes andyholmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 🙂

src/Library/demos/Memory Monitor/main.js Outdated Show resolved Hide resolved
src/Library/demos/Memory Monitor/main.js Show resolved Hide resolved
@andyholmes andyholmes self-assigned this Aug 19, 2023
Copy link
Contributor

@andyholmes andyholmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one!

@andyholmes andyholmes merged commit 6f4c508 into main Aug 19, 2023
sonnyp pushed a commit that referenced this pull request Aug 19, 2023
* 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) {

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.

Copy link
Contributor Author

@AkshayWarrier AkshayWarrier Aug 20, 2023

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.

sonnyp pushed a commit that referenced this pull request Aug 20, 2023
* library: Add Memory Monitor entry

* Update main.json

* Update main.blp

* Memory Monitor: Suggestions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory Monitor demo
3 participants