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

vmem allocation could be smarter #1800

Open
pshipton opened this issue Oct 10, 2017 · 1 comment
Open

vmem allocation could be smarter #1800

pshipton opened this issue Oct 10, 2017 · 1 comment

Comments

@pshipton
Copy link
Contributor

Derived from eclipse-openj9/openj9#270

A omrvmem_reserve_memory_ex() call with a startAddress and endAddress, using the default page size, getMemoryInRangeForDefaultPages() is called, OMRPORT_VMEM_ALLOC_QUICK is not set. The OS returns an address which is smaller than the startAddress. The algorithm increments the startAddress continuously, looking for an allocation that satisfies the requirements. This doesn't fail until the updated startAddress gets close enough to the endAddress that the request can no longer be satisfied. The search can take quite a long time when using 64-bit memory addresses.

A possible improvement is to assume when the returned address is smaller than the startAddress, the request will never be satisfied, and fail early.

@keithc-ca
Copy link
Contributor

In an interim version of #2743 I had modified the search order to attempt allocations at addresses more widely separated first and gradually filling in the gaps. It did help when OMRPORT_VMEM_ALLOC_QUICK failed; the problem was that OMRPORT_VMEM_ALLOC_QUICK should not have failed in the scenarios we see and so improvements to the last-resort scan (that we won't get to) become less important if #2743 is accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants