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

    https://github.com/apache/spark/pull/19025#discussion_r135195514
  
    --- Diff: core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java 
---
    @@ -53,7 +53,7 @@
      * retrieve the base object.
      * <p>
      * This allows us to address 8192 pages. In on-heap mode, the maximum page 
size is limited by the
    - * maximum size of a long[] array, allowing us to address 8192 * 2^32 * 8 
bytes, which is
    + * maximum size of a long[] array, allowing us to address 8192 * 2^31 * 8 
bytes, which is
    --- End diff --
    
    8192*(2^31-1)*8 = 1.4073749e+14. A terabyte is 10^12 bytes, so that's about 
140. I think you're thinking that giga/terabytes are a power of 2 bytes, and 
they're not. 
    
    The 35 error comes from omitting the factor of 8 (8x too small), but having 
an array size 2x too long (2^32). It should net-net be 4x larger. 35 * 4 = 140


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to