incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Brosius <dbros...@mebigfatguy.com>
Subject Re: memory estimate for each key in the key cache
Date Sat, 17 Dec 2011 03:31:56 GMT
On 12/16/2011 10:13 PM, Brandon Williams wrote:
> On Fri, Dec 16, 2011 at 8:52 PM, Kent Tong<freemant2000@yahoo.com>  wrote:
>> Hi,
>>
>>  From the source code I can see that for each key, the hash (token), the key itself
(ByteBuffer) and the position (long. offset in the sstable) are stored into the key cache.
The hash is an MD5 hash, so it is 16 bytes. So, the total size required is at least 16+size-of(key)+4
which is>  20 bytes. If we consider the overhead of the object references, then it will
be even larger. Then, why the wiki recommends multiplying the  number of keys cached with
10-12 to get the memory requirement?
> In a word: java.
>
> -Brandon
>

Wow, Java is a lot better than I thought if it can perform that kind of 
magic.  I'm guessing the wiki information is just old and out of date. 
It's probably more like 60 + sizeof(key)

Mime
View raw message