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

Thomas Koch commented on ZOOKEEPER-1288:
----------------------------------------

A related idea to this: In my refactoring branch I've replaced long zxid with a 
Zxid class that also holds the time correlated to a zxid. Using such an object 
an giving it a toString method could solve the problem.

Current memory usage of zxid and time in a DataNode:
4 bytes reference to StatPersisted
8 bytes StatPersisted object header
16 bytes for two timestamps
32 bytes for three zxid longs
====
68 bytes

Moving everything from StatPersisted directly in the DataNode and reuse same 
Zxids across DataNodes:

3*4 bytes for references to each Zxid
8 bytes object overhead for a Zxid
2*8 bytes for actual zxid and timestamp values in the Zxid object
====
36 bytes

Savings: Around 32 bytes for each DataNode in the system assuming that there 
are only as many zxid objects as there are datanodes.
                
> Always log sessionId and zxid as hexadecimals
> ---------------------------------------------
>
>                 Key: ZOOKEEPER-1288
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1288
>             Project: ZooKeeper
>          Issue Type: Sub-task
>            Reporter: Thomas Koch
>            Assignee: Thomas Koch
>
> At some points, sessionIds or zxid are written in decimal numbers to the log 
> but most of the time as hexadecimals. It's an unnecessary hassle to manually 
> convert these numbers to find additional log lines referring the same 
> numbers. Or worse people may not know that there may be additional 
> information available if they also search for the decimal representation of a 
> number.

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