-
1. Re: [-22]Error:= Invalid argument when write with AsynchronousFile
clebert.suconic Jan 31, 2012 11:24 AM (in response to iron9light)What kind of buffer are you using?
Linux AIO requires Native Buffers, aligned to 512.
So, the writes you make have to be aligned to 512.
All the buffers on Java are already using the malloc version that aligns to 512. However releasing a native buffer in Java sucks, as the major portion will be outside of the JRE space, so GC will take longer usually than needed to release the native buffer. Because that I either reuse the buffers as most as I can or I use the native methods to allocate and release native buffers. (i.e doing my own control).
Also: another thing I discovered is that libaio will have thread context control. If you make all the writes using a single thread you will get a higher throughput. (Believe it or not!). (Even if you use a SingleThreadExecutor to make all your writes).
-
2. Re: [-22]Error:= Invalid argument when write with AsynchronousFile
iron9light Jan 31, 2012 9:02 PM (in response to clebert.suconic)Now I use AsynchronousFileImpl.newBuffer(5120) to create my buffer
But the size to write is src.remaining which is less than 512.
Got the same -22 error.
Dose the size need to be x512 too? If so, how about I only wanna write 32b and close the file?
What does AsynchronousFileImpl.clearBuffer do?
Best regards,
IL
-
3. Re: [-22]Error:= Invalid argument when write with AsynchronousFile
iron9light Jan 31, 2012 9:39 PM (in response to iron9light)size = x512 works.
But how about I only wanna write less than 512b?