On 04/07/2008 02:05 AM, "이희승 (Trustin Lee) <[EMAIL PROTECTED]>" wrote:
I have implemented a quick prototype of mina JNI extension and the
ByteBuffer allocated by glibc malloc seems to show the same performance
characteristics as expected.

I also suggested (in IRC) to try mapping anonymous pages via mmap.  Transcript:

<dmlloyd> trustin: another JNI experiment that might be interesting to try, would be to try using mmap/munmap to allocate memory (if you're doing big chunks). This would work better on 64-bit systems though.
<trustin> dmlloyd: how big?
<vrm> big enougth pool ;)
<dmlloyd> hm, I dunno :)  let me look at the man page
<dmlloyd> I guess use your judgement - the granularity is one page usually, but you don't want to go that small
<dmlloyd> I'd say 512k to 1MB
<dmlloyd> that's a gut guess though :)
<dmlloyd> 1MB would yield 64 16k buffers, and even a 16k user buffer is pretty big imo
<dmlloyd> 1024 1k buffers
<dmlloyd> so I guess you could allocate maybe 10 1MB buffers and be set for life, for most applications :)
<dmlloyd> I'll post the idea to mina-dev too
<trustin> sounds great
<vrm> chunks bigger than 1MB shouldn't appear (except transfering a big file with aweb)
<dmlloyd> would you really want to buffer all 1MB in RAM at once though?
<dmlloyd> for transferring big files, I'd spool it to disk once it gets bigger than about 16k I guess
<vrm> never tried but I can bid it'll scale badly

- DML

Reply via email to