You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by "mcmellawatt (GitHub)" <gi...@apache.org> on 2018/09/13 17:45:08 UTC

[GitHub] [geode] mcmellawatt commented on issue #2459: GEODE-5725: Using string values to exercise off-heap

> A more descriptive message as to why this change is desired would be great. As it is, the change looks OK but I wouldn't know why.
> 
> Looking at the JIRA, it seems we need the value to be > 8 bytes. What is the actual size in bytes of these string values?

@pdxrunner - would "Using <8 bit values to exercise off-heap in tests" be better?  The why is basically because we were not exercising off-heap when we thought we were in our WAN DUnit tests as described in the Jira, but I prefer to keep commit message short and succinct.  If they want the details, they can read the Jira ticket.

Regarding the size of these string values, they are serialized as modified UTF-8 with two bytes of length information.  The minimum length of the string is 8 chars: (7 for "Value_") + (1 for smallest long.toString() e.g. '0') + null terminator = 8 chars.  In its serialized form, this results in 10 byte values at a minimum, which is larger than the 8 byte cutoff for off-heap to be exercised.  Of course if once the long hits more than 1 character the size will increase, but the value will be 10 bytes minimum which is sufficient for these tests.

[ Full content available at: https://github.com/apache/geode/pull/2459 ]
This message was relayed via gitbox.apache.org for notifications@geode.apache.org