Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

avu
Copy link
Contributor

@avu avu commented Jun 1, 2021

Used MTLDevice recommendedMaxWorkingSetSize property for optimal size of the texture pool


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

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

Used MTLDevice recommendedMaxWorkingSetSize property for optimal size of the texture pool
@bridgekeeper
Copy link

bridgekeeper bot commented Jun 1, 2021

👋 Welcome back avu! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 1, 2021
@openjdk
Copy link

openjdk bot commented Jun 1, 2021

@avu The following label will be automatically applied to this pull request:

  • 2d

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the 2d client-libs-dev@openjdk.org label Jun 1, 2021
@mlbridge
Copy link

mlbridge bot commented Jun 1, 2021

Webrevs


if (_maxPoolMemory < MAX_POOL_MEMORY) {
_maxPoolMemory = MAX_POOL_MEMORY;
}
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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

@openjdk
Copy link

openjdk bot commented Jun 7, 2021

@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:

8261549: Adjust memory size in MTLTexurePool.m

Reviewed-by: prr

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 master branch:

  • 3396b69: 8254129: IR Test Framework to support regex-based matching on the IR in JTreg compiler tests
  • 270ec97: 8268331: Fix crash in humongous object eager reclaim logging
  • ea8274f: 8267875: Shenandoah: Duplicated code in ShenandoahBarrierSetC2::ideal_node()
  • a91f971: 8268267: Remove -Djavatest.security.noSecurityManager=true from jtreg runs
  • 4f9d6b7: 8267465: remove superfluous preview related annotations and test options
  • 728a411: 8268018: remove dead code in commitLimitter
  • 15715a8: 8267924: Misleading G1 eager reclaim detail logging
  • e4d0454: 8267832: SimpleVisitors and Scanners in jdk.compiler should use @implSpec
  • 8130be5: 8268318: Missing comma in copyright header
  • b09d8b9: 8267926: AsyncLogGtest.java fails on assert with: decorator was not part of the decorator set specified at creation.
  • ... and 115 more: https://git.openjdk.java.net/jdk/compare/c06db45fa77c8a90518d6ff023de6c46b7c89997...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jun 7, 2021
@avu
Copy link
Contributor Author

avu commented Jun 7, 2021

/integrate

@openjdk openjdk bot closed this Jun 7, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 7, 2021
@openjdk
Copy link

openjdk bot commented Jun 7, 2021

@avu Since your change was applied there have been 126 commits pushed to the master branch:

  • e663ba9: 8268299: jvms tag produces incorrect URL
  • 3396b69: 8254129: IR Test Framework to support regex-based matching on the IR in JTreg compiler tests
  • 270ec97: 8268331: Fix crash in humongous object eager reclaim logging
  • ea8274f: 8267875: Shenandoah: Duplicated code in ShenandoahBarrierSetC2::ideal_node()
  • a91f971: 8268267: Remove -Djavatest.security.noSecurityManager=true from jtreg runs
  • 4f9d6b7: 8267465: remove superfluous preview related annotations and test options
  • 728a411: 8268018: remove dead code in commitLimitter
  • 15715a8: 8267924: Misleading G1 eager reclaim detail logging
  • e4d0454: 8267832: SimpleVisitors and Scanners in jdk.compiler should use @implSpec
  • 8130be5: 8268318: Missing comma in copyright header
  • ... and 116 more: https://git.openjdk.java.net/jdk/compare/c06db45fa77c8a90518d6ff023de6c46b7c89997...master

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2d client-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

2 participants