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

Include cached memory into usable memory calculation #10

Merged
merged 3 commits into from
Feb 16, 2021
Merged

Include cached memory into usable memory calculation #10

merged 3 commits into from
Feb 16, 2021

Conversation

KreativeKrise
Copy link
Contributor

The memory calculation should also count cached memory into unused memory, because cached memory will be freed when applications require it.

The memory calculation should also count cached memory into unused memory, because cached memory will be freed when applications require it.
@wernerfred wernerfred self-assigned this Feb 16, 2021
@wernerfred
Copy link
Owner

Hey, thanks for your contribution.
Technically speaking cached memory isn't free (it's cached ;). But I get your point.
Thinking about existing (historical) data it might not seem a good idea to change the calculation of free memory.
What do you think about calling it usable memory from now on? Like this:

OK - 70.7% usable (232.4 MB free and 1032.0 cached out of 1828.1 MB) |memory_total=1871928c memory_unused=1323004c memory_percent=70% memory_cached=1031928c

@KreativeKrise
Copy link
Contributor Author

Yes, that makes totally sense. Since I don't use historical data yet, I didn't thought on that use case.

@wernerfred
Copy link
Owner

wernerfred commented Feb 16, 2021

Please take a look at my update, check it at your environment and provide feedback.
If everything works I will merge the PR

@wernerfred wernerfred added the waiting for contributor action Waiting for the contributor to respond label Feb 16, 2021
Copy link
Contributor Author

@KreativeKrise KreativeKrise left a comment

Choose a reason for hiding this comment

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

The changes work without any problem.

@wernerfred
Copy link
Owner

Keep in mind that if #9 gets merged you need to update your check command ;)

@wernerfred wernerfred changed the title Include cached memory into unused memory calculation Include cached memory into usable memory calculation Feb 16, 2021
@wernerfred wernerfred merged commit e3c0d26 into wernerfred:master Feb 16, 2021
@wernerfred
Copy link
Owner

@all-contributors please add @KreativeKrise for code

@allcontributors
Copy link
Contributor

@wernerfred

I've put up a pull request to add @KreativeKrise! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for contributor action Waiting for the contributor to respond
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants