Measure memory usage during memtests #411
Merged
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.
Closes #406.
This modifies the tests in
tests_mem/
to help investigate potential memory leaks.In normal mode, runs the test twice for each object, with two different object-amounts. In memory-usage-mode, runs 40 iterations with an object-count of 8, track memory usage at each iteration, and report that.
TEST_ITERS
it will run that many iterations with 8 objects, printing diff memory usage at each iteration.This work was originally about that last step, but in the end these memory measurement are pretty hard to interpret. They can sometimes be useful, and perhaps we can improve it in the future? But for now we only run those tests manually, not in CI.
Example:
For the GUI backends, the memory usage seems to consistently increase. E.g. for glfw:
I'm not sure what to make of this, t.b.h. ... I wonder how useful these numbers are at all ...
For example, the glfw
Canvas
objects are deleted, so this is probably memory that glfw manages and may release at a later time? If I run with more iterations, I do see that memory is released (i.e. negative numbers in above tables), but not as much as is consumed.