John Blum created GEODE-10035:
---------------------------------
Summary: The System property condition to use "direct" ByteBuffers
in P2P is wrong
Key: GEODE-10035
URL: https://issues.apache.org/jira/browse/GEODE-10035
Project: Geode
Issue Type: Improvement
Affects Versions: 1.14.3
Reporter: John Blum
In the {{o.a.g.internal.net.ByteBuffer.useDirectBuffers}} class member (static)
constant field
([source|https://github.com/apache/geode/blob/rel/v1.14.3/geode-core/src/main/java/org/apache/geode/internal/net/BufferPool.java#L82-L83]),
which is derived from either the "{{p2p.nodirectBuffers"}} OR the
"{{gemfire.BufferPool.useHeapBuffers}}" System properties, the conditional
logic is incorrect!
It should read:
{code:java}
public static final boolean useDirectBuffers = !(
Boolean.getBoolean("p2p.nodirectBuffers")
||
Boolean.getBoolean(GeodeGlossary.GEMFIRE_PREFIX+"BufferPool.useHeapBuffers")
);
{code}
The term "{{useHeapBuffers}}" implies that the buffer should created on the JVM
Heap, and not in main memory as a "direct" ByteBuffer.
Setting the System property "{{gemfire.BufferPool.useHeapBuffers}}" to
"{{true}}" would result in a direct ByteBuffer allocation as can be seen
[here|https://github.com/apache/geode/blob/rel/v1.14.3/geode-core/src/main/java/org/apache/geode/internal/net/BufferPool.java#L104-L115],
rather than what should happen
[here|https://github.com/apache/geode/blob/rel/v1.14.3/geode-core/src/main/java/org/apache/geode/internal/net/BufferPool.java#L117].
--
This message was sent by Atlassian Jira
(v8.20.1#820001)