You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by GitBox <gi...@apache.org> on 2021/08/10 17:03:13 UTC

[GitHub] [datasketches-memory] leerho commented on a change in pull request #136: Ds java issue358

leerho commented on a change in pull request #136:
URL: https://github.com/apache/datasketches-memory/pull/136#discussion_r686159548



##########
File path: datasketches-memory-java8/src/main/java/org/apache/datasketches/memory/WritableBuffer.java
##########
@@ -363,10 +366,11 @@ void putBooleanArray(boolean[] srcArray, int srcOffsetBooleans,
 
   //OTHER WRITABLE API METHODS
   /**
-   * For Direct Memory only. Other types of backing resources will return null.
-   * Gets the MemoryRequestServer object used by dynamic off-heap (Direct) memory objects
-   * to request additional memory.
-   * Set using {@link WritableMemory#allocateDirect(long, MemoryRequestServer)}.
+   * For ByteBuffer and Direct Memory backed resources only. Heap and Map backed resources will return null.
+   * Gets the MemoryRequestServer object used by dynamic Memory-backed objects
+   * to request additional memory.  To customize the actions of the MemoryRequestServer,
+   * extend the MemoryRequestServer interfact and
+   * set using {@link WritableMemory#allocateDirect(long, ByteOrder, MemoryRequestServer)}.

Review comment:
       The original design provided the MemoryRequestServer callback only for Memory segments allocated via `WritableMemory.allocateDirect(...) `calls.  Memory segments allocated via WritableMemory.wrap(ByteBuffer) did not have this capability.  This was a major oversight since all off-heap memory in Druid is allocated using ByteBuffers!  It is unusual that no one has uncovered this until now.  Nonetheless, the fix involves instrumenting all the paths involved in providing this callback mechanism for wrapped ByteBuffers.  




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org