-
Notifications
You must be signed in to change notification settings - Fork 915
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
Added pinned pool reservation API for java #13964
Added pinned pool reservation API for java #13964
Conversation
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.
LGTM, nits
if (section.size >= bytes && section.size <= alignedSize) { | ||
allocated = section; | ||
section = null; | ||
// Not need for reserveAllocInternal because the original section is already tracked |
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.
// Not need for reserveAllocInternal because the original section is already tracked | |
// No need for reserveAllocInternal because the original section is already tracked |
@Override | ||
public synchronized HostMemoryBuffer allocate(long bytes) { | ||
if (section == null || section.size < bytes) { | ||
throw new OutOfMemoryError("Reservation didn't have enough space for " + bytes); |
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.
would it be helpful for diagnostics to include the section=null / section.size in the exception message?
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.
LGTM
/merge |
Description
This adds in an API to java to reserve pinned memory. It is very much like allocating it, but provides a way to guarantee up front that there is enough memory for multiple allocations to succeed.
Checklist