-
Notifications
You must be signed in to change notification settings - Fork 70
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
Fix #126 "Make sure bytebuffer never exceeds Integer.MAX_VALUE" #154
Conversation
@mielvds it was your issue if you want to review this PR :) |
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.
Hi @ate47 , very nice! It's not ideal of course, because using more memory is contradicting the use of memory mapping a bit, but it will definitely do. I was wondering: were you able to recreate the orginal issue in the end?
The original code was already splitting the file into buffers. in fact when I've tried the HDT mentioned in the issue, without counting my splitting, the number of buffer was 237 with only 5 BigMappedByteBuffers with a I wasn't able to recreate the original issue after my fix. |
great!
I meant before your fix? because I wasn't sure about the root of the problem. |
Ah! Yes it was crashing at this line: Line 138 in e29e4fc
Because |
Great! I was wondering whether this should be merged in the master branch instead of the 3.0.0 and release a 2.2.1. WDYT @D063520 ? |
I've rebased my change to the master branch |
Yes, sure, I can do it .... to test again the CI ... but it is very strange that it is not findable in mvn central yet |
I'm also not sure why, but let's check again on monday to be sure, cuz this process is very slow. |
I've made this little fix for #126, it's using multiple MappedByteBuffer instead of one if the size of the bytebuffer is too big (the max size is set to Integer.MAX_VALUE)
Because the ByteBuffer classes constructors of the nio package are package-private, I wasn't able to create a children of the ByteBuffer class, so I cloned the methods using the ByteBuffer to use my new class, BigMappedByteBuffer.
Tests
I've tried all the methods reimplemented to see if it was working across multiple mapped buffers. So 5 new tests were added + 1 ignored because it was using the test HDT
dbpedia2016-10.hdt
. (36GB+)