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

Todd Lipcon commented on HBASE-5347:
------------------------------------

Hey folks. I haven't been through the patch yet, but just wanted to throw out 
one idea that I think can make reference-counted systems a little simpler: in 
Cocoa (the OSX development framework) there's a class called NSAutoreleasePool, 
an instance of which is carried around as part of the local thread context. You 
can then call "autorelease" on any object, which will not immediately decrement 
the ref count, but adds it to the pool. When you release the pool, all 
referenced objects are decremented at that point.

This idea might make it easier to manage references. For example, when 
something is read by a scanner, it could be read with ref count incremented but 
put on the request's autorelease pool. Then, when any IPC handler thread is 
returned to the thread pool, the auto release pool could be decremented. This 
ensures that any stuff we reference is kept around for the whole request 
lifecycle but still automatically dereffed at the end.

Do you think such a construct would be useful here?

https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmAutoreleasePools.html
 has some more info.
                
> GC free memory management in Level-1 Block Cache
> ------------------------------------------------
>
>                 Key: HBASE-5347
>                 URL: https://issues.apache.org/jira/browse/HBASE-5347
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Prakash Khemani
>            Assignee: Prakash Khemani
>         Attachments: D1635.5.patch
>
>
> On eviction of a block from the block-cache, instead of waiting for the 
> garbage collecter to reuse its memory, reuse the block right away.
> This will require us to keep reference counts on the HFile blocks. Once we 
> have the reference counts in place we can do our own simple 
> blocks-out-of-slab allocation for the block-cache.
> This will help us with
> * reducing gc pressure, especially in the old generation
> * making it possible to have non-java-heap memory backing the HFile blocks

--
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

        

Reply via email to