Github user kiszk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19222#discussion_r170622554
  
    --- Diff: 
common/unsafe/src/main/java/org/apache/spark/unsafe/memory/UnsafeMemoryAllocator.java
 ---
    @@ -19,15 +19,24 @@
     
     import org.apache.spark.unsafe.Platform;
     
    +import java.lang.reflect.InvocationTargetException;
    +import java.lang.reflect.Method;
    +import java.nio.ByteBuffer;
    +
    +import sun.nio.ch.DirectBuffer;
    +
     /**
      * A simple {@link MemoryAllocator} that uses {@code Unsafe} to allocate 
off-heap memory.
      */
     public class UnsafeMemoryAllocator implements MemoryAllocator {
     
       @Override
    -  public MemoryBlock allocate(long size) throws OutOfMemoryError {
    +  public OffHeapMemoryBlock allocate(long size) throws OutOfMemoryError {
    +    // No usage of DirectByteBuffer.allocateDirect is current design
    --- End diff --
    
    Let me put this comment here
    ```
    No usage of DirectByteBuffer.allocateDirect is current design
    Platform.allocateMemory is used here.
    
http://downloads.typesafe.com/website/presentations/ScalaDaysSF2015/T4_Xin_Performance_Optimization.pdf#page=26
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to