You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directmemory.apache.org by "Benoit Perroud (Commented) (JIRA)" <ji...@apache.org> on 2011/12/28 19:28:31 UTC

[jira] [Commented] (DIRECTMEMORY-28) Consider using Unsafe instead DirectBuffer

    [ https://issues.apache.org/jira/browse/DIRECTMEMORY-28?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13176742#comment-13176742 ] 

Benoit Perroud commented on DIRECTMEMORY-28:
--------------------------------------------

Cassandra uses Unsafe for a simple reason : they are allocating a different memory region for *every* cached object. Having this in mind, Unsafe.free directly free and return the region (you need to pay extra attention to not read this region anymore), while ByteBuffer allocation need to wait for grabage collection to be effectively freed. In the case of DM, as buffers are way less frequently allocated and desallocated, I'm not sure the usage of Unsafe will add lot of improvement.
                
> Consider using Unsafe instead DirectBuffer
> ------------------------------------------
>
>                 Key: DIRECTMEMORY-28
>                 URL: https://issues.apache.org/jira/browse/DIRECTMEMORY-28
>             Project: Apache DirectMemory
>          Issue Type: Improvement
>            Reporter: Raffaele P. Guidi
>            Priority: Minor
>
> I already tried in the past but without too much success. Does it give any performance improvement (considered the way we use it)?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira