-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8261549: Adjust memory size in MTLTexurePool.m #4279
Conversation
Used MTLDevice recommendedMaxWorkingSetSize property for optimal size of the texture pool
👋 Welcome back avu! A progress list of the required criteria for merging this PR into |
Webrevs
|
|
||
if (_maxPoolMemory < MAX_POOL_MEMORY) { | ||
_maxPoolMemory = MAX_POOL_MEMORY; | ||
} |
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.
The Apple 5K retina is 5120‑by‑2880 pixels
So we start off with a number that is too small
#define SCREEN_MEMORY_SIZE_4K (409621604) //~33,7 mb
and then divide it by 2
#define MAX_POOL_MEMORY SCREEN_MEMORY_SIZE_4K/2
and I have no idea what a typical size is for
self.device.recommendedMaxWorkingSetSize
which we are also dividing by 2.
So I have no idea what the logic is behind all these numbers.
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.
The Apple 5K retina is 5120‑by‑2880 pixels
So we start off with a number that is too small
#define SCREEN_MEMORY_SIZE_4K (4096_2160_4) //~33,7 mb
and then divide it by 2
#define MAX_POOL_MEMORY SCREEN_MEMORY_SIZE_4K/2
I didn't touch this number here, they worked well within our EA testing cycles. So, I decided to use it as a fallback. We can extend it to 5K though.
and I have no idea what a typical size is for
self.device.recommendedMaxWorkingSetSize
which we are also dividing by 2.
This size typically much much bigger than SCREEN_MEMORY_SIZE_4K
- 4GB on Radeon Pro 560X 4GB
- 1.5GB Intel UHD Graphics 630 1536 MB (MBP 2019)
Looks like it corresponds to the amount of VRAM however the doc says that OS may set another value
An approximation of how much memory, in bytes, this device can use with good performance.
I don't think that it's a good idea to take all the recommended VRAM, so decided to divide it by 2.
So I have no idea what the logic is behind all these numbers.
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.
OK. Can you add some of this info to the bug report.
Notabkly the typical size for self.device.recommendedMaxWorkingSetSize
Increased default pool size
@avu This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 125 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
/integrate |
@avu Since your change was applied there have been 126 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 7e55569. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Used MTLDevice recommendedMaxWorkingSetSize property for optimal size of the texture pool
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4279/head:pull/4279
$ git checkout pull/4279
Update a local copy of the PR:
$ git checkout pull/4279
$ git pull https://git.openjdk.java.net/jdk pull/4279/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 4279
View PR using the GUI difftool:
$ git pr show -t 4279
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4279.diff