Repository navigation
Conversation
Without psutil, /__dev/api/status memory_usage_mb and /__dev/api/system memory_mb both carried the peak resident set size, so a server that had grown once and freed the memory kept showing the high-water mark as its current usage. Current usage now comes from psutil when installed, else from VmRSS in /proc/self/status. Where neither is available the status field stays 0.0 and the system field None; the peak is never reported as current usage. Signed-off-by: Michael <michael@codeinfinity.co.za>
Collaborator
Author
|
I have read the Tina4 Contributor Licence Agreement and I agree to it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
Without psutil installed, the dev admin showed peak memory as current memory.
/__dev/api/statusmemory_usage_mband/__dev/api/systemmemory_mb(the dashboard's Memory figure) both carried the peak resident set size, so a server that grew once and freed the memory kept showing the high-water mark.Measured on v3 after allocating and freeing 150 MB: both fields 184.66 MB, kernel VmRSS 37.3 MB.
What changes
VmRSSin/proc/self/status(Linux, Android)./statuskeeps its0.0fallback and/systemitsNone. The peak is never reported as current usage.peak_memory_mbis unchanged.After the change, same scenario: 38.3 MB against VmRSS 38.3 MB.
Tests
Three new tests in
tests/test_dev_admin.py; all fail on v3 and pass here. Full suite: the same 9 failures before and after.Not run
macOS and Windows paths were read, not executed.