[
https://issues.apache.org/jira/browse/CASSANDRA-1969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12988607#action_12988607
]
Jonathan Ellis commented on CASSANDRA-1969:
-------------------------------------------
Attached another approach in two patches:
01: introduce ICache, InstrumentingCache, IRowCacheProvider
This takes the JMX instrumentation and moves it into a wrapper class
(InstrumentingCache) so we don't need to re-implement that for each cache.
Then we make the row cache interface pluggable with IRowCacheProvider.
02: implement SerializingCache
Trying to implement off-heap caching with allocateDirect is messy; the original
approach is going to fragment quickly, and allocation is O(N) in the number of
freed chunks. (I think there may also be a leak since there is no eviction
listener on the CLHM.) This is a problem that malloc already solves, so
SerializingCache uses FreeingMemory, derived from jna Memory, to access
malloc/free directly.
I left out anything based on EHCache; as described in CASSANDRA-1945 the
performance penalty from using JDK serialization is prohibitive.
TODO:
- (for this ticket) specifying cache provider in the CF definition
- (for another ticket) adding a deserialize(ByteBuffer) method to
ColumnFamilySerializer to avoid copies (using BB.duplicate for column names and
values)
> Use BB for row cache - To Improve GC performance.
> -------------------------------------------------
>
> Key: CASSANDRA-1969
> URL: https://issues.apache.org/jira/browse/CASSANDRA-1969
> Project: Cassandra
> Issue Type: Improvement
> Components: Core
> Environment: Linux and Mac
> Reporter: Vijay
> Assignee: Vijay
> Priority: Minor
> Attachments: 0001-Config-1969.txt, 0002-Update_existing-1965.txt,
> 0003-New_Cache_Providers-1969.txt, 0004-TestCase-1969.txt, BB_Cache-1945.png,
> JMX-Cache-1945.png, Old_Cahce-1945.png, POC-0001-Config-1945.txt,
> POC-0002-Update_existing-1945.txt, POC-0003-New_Cache_Providers-1945.txt
>
>
> Java BB.allocateDirect() will allocate native memory out of the JVM and will
> help reducing the GC pressure in the JVM with a large Cache.
> From some of the basic tests it shows around 50% improvement than doing a
> normal Object cache.
> In addition this patch provide the users an option to choose
> BB.allocateDirect or store everything in the heap.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.