hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Holstad (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HBASE-1590) Extend TestHeapSize and ClassSize to do "deep" sizing of Objects
Date Wed, 01 Jul 2009 21:39:47 GMT

    [ https://issues.apache.org/jira/browse/HBASE-1590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12726234#action_12726234
] 

Erik Holstad commented on HBASE-1590:
-------------------------------------

Have been working on a deepClassSize and have a working version of it. There are a couple
of things that makes the whole concept of checking the size of a class rather than 
an object hard. Let's take the TreeMap as an example, it has a reference to the root entry
which in has references to entry left, right and parent, so how do you know when to stop?

>From the two main goals we already have 1 so we have 2 left.
One thing we could do, is to lift some test code using Instrumention.getObjectSize() into
some test, so we don't have to include the jar. The problem is then how we should run it,
since it requires  -javaagent:/home/erik/src/tgzs/SizeOf.jar at the moment. Will see if I
can work around this, to be able to use in unit test.


> Extend TestHeapSize and ClassSize to do "deep" sizing of Objects
> ----------------------------------------------------------------
>
>                 Key: HBASE-1590
>                 URL: https://issues.apache.org/jira/browse/HBASE-1590
>             Project: Hadoop HBase
>          Issue Type: Improvement
>    Affects Versions: 0.20.0
>            Reporter: Jonathan Gray
>             Fix For: 0.20.0
>
>
> As discussed in HBASE-1554 there is a bit of a disconnect between how ClassSize calculates
the heap size and how we need to calculate heap size in our implementations.
> For example, the LRU block cache can be sized via ClassSize, but it is a shallow sizing.
 There is a backing ConcurrentHashMap that is the largest memory consumer.  However, ClassSize
only counts that as a single reference.  But in our heapSize() reporting, we want to include
*everything* within that Object.
> This issue is to resolve that dissonance.  We may need to create an additional ClassSize.estimateDeep(),
we may need to rethink our HeapSize interface, or maybe just leave it as is.  The two primary
goals of all this testing is to 1) ensure that if something is changed and the sizing is not
updated, our tests fail, and 2) ensure our sizing is as accurate as possible.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message