fix the calculation of RAM in MEM to ensure MEM_MAX_THREADS works cor…#545
Open
nazarenkomykyta wants to merge 2 commits into
Open
fix the calculation of RAM in MEM to ensure MEM_MAX_THREADS works cor…#545nazarenkomykyta wants to merge 2 commits into
nazarenkomykyta wants to merge 2 commits into
Conversation
…rectly Bash completely discards the remainder in this division; that is, if we run make.sh on a machine with a non-standard amount of RAM, for example, on SBC with 8.5 GB of RAM - then after this conversion, we’ll end up with exactly 8 GB, which is incorrect.
Owner
|
Hi @nazarenkomykyta - thanks for contributing. I agree the current calculation is not perfect. The rounding to full GB was intentional though, but I'm open to changing that to perhaps round to nearest 512 MB. I suspect going to more detailed level will lead to "wrong number" as the number reported by these tools differs a bit from actual physical mem size. I have attached a patch which seems to work OK on a couple of my test systems (mac, linux, openbsd). Could you try it out and see if it would work for your systems too? |
Author
|
Your patch makes sense. |
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.
Bash completely discards the remainder in this division; that is, if we run make.sh on a machine with a non-standard amount of RAM, for example, on SBC with 8.5 GB of RAM - then after this conversion, we’ll end up with exactly 8 GB, which is incorrect.