-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Reduced memory usage in HighPerformance tests #3408
Reduced memory usage in HighPerformance tests #3408
Conversation
Thanks Sergio0694 for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
Nice! |
@azchohfi Thanks! Sorry it didn't occur to me earlier to make this change! 😅 |
Time will tell... I hate random issues.... |
Nop, still got an error:
|
Ok this is weird though. has the memory limit been reduced recently for the CI? One easy solution would be to just drop the tests using 64 bit values. The overflow threshold is the same as the one for 32 bit values anyway, and the code path is the same as well. Technically that'd still be a slightly less "tested" API as a result, but maybe that's a compromise you guys are willing to make if these tests are such a problem for the CI? I mean we could nuke these (and the ones with the "filled" variant too): @azchohfi Let me know what you think! 👍 |
I don't want to nuke it... If we support it and there is a way to test it, lets test it. Is there a way to split this? Maybe its because we are now running tests in parallel. |
Possibly a dumb question, but if we're running tests in parallel, wouldn't splitting this test into multiple tests (eg. one per type) cause this error to be even more frequent? I mean, since each type test requires an array to be allocated, and if those were separate tests that could all be run in paralell, the test runner could end up allocating even more memory at once? 🤔 On this point... What if we instead merge the random/filled tests into a single test? P.S. that's a nice box you have there! 😄🚀 |
Parallel tests are configured to be by class already, so splitting it into the same class would only make sure that per-test tear down happens completely (if there is anything that is split there), and hopefully some memory gets released, but I don't think it would make much different. If we had a more complete error message/dump, we could know what is crashing with what, but I don't think we can know for a fact what will be too much memory with what, so maybe your suggestion actually works. |
Ah, yeah if they're parallelized per class then I guess that wouldn't really have helped much. |
It ran once fine and I thought you did it, but I ran it again and these 2 failed: |
Current code looks good, signed-off to unblock any updates. Seems like you both have a handle on things! :) |
Ok, ok, not too bad,that's progress 😄 I made some changes in 1dcdb24 and 7e7121c and moved all those tests to unmanaged memory management, so that they should all just straight up bypass the managed heap and cause no problems anymore. The CI is running again, fingers crossed! 🤞 EDIT: it worked! 🎉 |
Ugh, I think they moved/removed the option to re-run the pipeline (at least on a successful run?)?? @azchohfi do you know where they moved it? |
@michael-hawker @azchohfi Well the merge triggered the CI, and it run just fine again for the 2nd time in a row! Success? 🎉🎉🎉 |
I'll run it locally a couple of extra times now. |
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.
Yeah, 3 times in a row in my box, all passing 🎉🎉🎉🦙🐱💻
Fixes random CI
SystemOutOfMemoryException
-sPR Type
What kind of change does this PR introduce?
What is the current behavior?
The CI will randomly fail with an out of memory error.
What is the new behavior?
The error should be gone now. All the
Count
tests for theHighPerformance
package are now reusing arrays from the sameArrayPool<byte>
instance (since they use unmanaged types, so they can just be reinterpret-cast-ed to the necessary type every time). This should greatly reduce the total number of allocated arrays.PR Checklist
Please check if your PR fulfills the following requirements:
Pull Request has been submitted to the documentation repository instructions. Link:Sample in sample app has been added / updated (for bug fixes / features)Icon has been created (if new sample) following the Thumbnail Style Guide and templates