You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by andrewor14 <gi...@git.apache.org> on 2015/11/12 21:28:39 UTC

[GitHub] spark pull request: [SPARK-11710] Document new memory management m...

GitHub user andrewor14 opened a pull request:

    https://github.com/apache/spark/pull/9676

    [SPARK-11710] Document new memory management model

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/andrewor14/spark memory-management-docs

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/9676.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #9676
    
----
commit 812f506c9e40bbb9dbfccf718a671cc1fdac924c
Author: Andrew Or <an...@databricks.com>
Date:   2015-11-12T20:25:00Z

    Add a section on memory management overview
    
    also remove references to legacy mode configs and update the
    description of the new configs to link to this section.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11710] Document new memory management m...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/9676#issuecomment-156561697
  
    **[Test build #45896 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/45896/consoleFull)** for PR 9676 at commit [`8afd5bd`](https://github.com/apache/spark/commit/8afd5bdb8fe0b66b581e5e90492a40e9d315ae60).


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11710] Document new memory management m...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9676#discussion_r44834000
  
    --- Diff: docs/tuning.md ---
    @@ -88,9 +88,40 @@ than the "raw" data inside their fields. This is due to several reasons:
       but also pointers (typically 8 bytes each) to the next object in the list.
     * Collections of primitive types often store them as "boxed" objects such as `java.lang.Integer`.
     
    -This section will discuss how to determine the memory usage of your objects, and how to improve
    -it -- either by changing your data structures, or by storing data in a serialized format.
    -We will then cover tuning Spark's cache size and the Java garbage collector.
    +This section will start with an overview of memory management in Spark, then discuss specific
    +strategies the user can take to make more efficient use of memory in her application. In
    +particular, we will describe how to determine the memory usage of your objects, and how to
    +improve it -- either by changing your data structures, or by storing data in a serialized
    +format. We will then cover tuning Spark's cache size and the Java garbage collector.
    +
    +## Memory Management Overview
    +
    +Memory usage in Spark largely falls into one of two categories: execution and storage.
    +Execution memory refers to that used for computation in shuffles, joins, sorts and aggregations,
    +while storage memory refers to that used for caching and propagating internal data across the
    +cluster. In Spark, execution and storage share a unified region (M). When no execution memory is
    +used, storage can acquire all the available memory and vice versa. Execution may evict storage
    +if necessary, but only until total storage memory usage falls under a certain threshold (R).
    +Storage may not evict execution due to complexities in implementation.
    +
    +This design ensures several desirable properties. First, applications that do not use caching
    +can use the entire space for execution, obviating unnecessary disk spills. Second, applications
    +that do use caching can reserve a minimum storage space (R) where their data blocks are immune
    +to being evicted. Lastly, this approach provides reasonable out-of-the-box performance for a
    +variety of workloads without requiring user expertise of how memory is divided internally.
    +
    +Although there are two relevant configurations, the typical user should not need to adjust them
    +as the default values are applicable to most workloads:
    +
    +* `spark.memory.fraction` expresses the size of `M` as a fraction of the total JVM heap space
    +(default 0.75). This sets aside memory for internal metadata, user data structures, and
    --- End diff --
    
    the next sentence explains it. Maybe the wording's not clear


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11710] Document new memory management m...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/9676#issuecomment-156568387
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/45896/
    Test PASSed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11710] Document new memory management m...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/9676#issuecomment-156225634
  
     Merged build triggered.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11710] Document new memory management m...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/9676#issuecomment-156227970
  
    **[Test build #45766 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/45766/consoleFull)** for PR 9676 at commit [`812f506`](https://github.com/apache/spark/commit/812f506c9e40bbb9dbfccf718a671cc1fdac924c).


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11710] Document new memory management m...

Posted by vidaha <gi...@git.apache.org>.
Github user vidaha commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9676#discussion_r44828910
  
    --- Diff: docs/tuning.md ---
    @@ -88,9 +88,40 @@ than the "raw" data inside their fields. This is due to several reasons:
       but also pointers (typically 8 bytes each) to the next object in the list.
     * Collections of primitive types often store them as "boxed" objects such as `java.lang.Integer`.
     
    -This section will discuss how to determine the memory usage of your objects, and how to improve
    -it -- either by changing your data structures, or by storing data in a serialized format.
    -We will then cover tuning Spark's cache size and the Java garbage collector.
    +This section will start with an overview of memory management in Spark, then discuss specific
    +strategies the user can take to make more efficient use of memory in her application. In
    +particular, we will describe how to determine the memory usage of your objects, and how to
    +improve it -- either by changing your data structures, or by storing data in a serialized
    +format. We will then cover tuning Spark's cache size and the Java garbage collector.
    +
    +## Memory Management Overview
    +
    +Memory usage in Spark largely falls into one of two categories: execution and storage.
    +Execution memory refers to that used for computation in shuffles, joins, sorts and aggregations,
    +while storage memory refers to that used for caching and propagating internal data across the
    +cluster. In Spark, execution and storage share a unified region (M). When no execution memory is
    +used, storage can acquire all the available memory and vice versa. Execution may evict storage
    +if necessary, but only until total storage memory usage falls under a certain threshold (R).
    +Storage may not evict execution due to complexities in implementation.
    +
    +This design ensures several desirable properties. First, applications that do not use caching
    +can use the entire space for execution, obviating unnecessary disk spills. Second, applications
    +that do use caching can reserve a minimum storage space (R) where their data blocks are immune
    +to being evicted. Lastly, this approach provides reasonable out-of-the-box performance for a
    +variety of workloads without requiring user expertise of how memory is divided internally.
    +
    +Although there are two relevant configurations, the typical user should not need to adjust them
    +as the default values are applicable to most workloads:
    +
    +* `spark.memory.fraction` expresses the size of `M` as a fraction of the total JVM heap space
    +(default 0.75). This sets aside memory for internal metadata, user data structures, and
    --- End diff --
    
    Can it be explained why ".75" is the default value?  What is the remaining .25% of memory allocated for?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11710] Document new memory management m...

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9676#discussion_r44822091
  
    --- Diff: docs/tuning.md ---
    @@ -88,9 +88,40 @@ than the "raw" data inside their fields. This is due to several reasons:
       but also pointers (typically 8 bytes each) to the next object in the list.
     * Collections of primitive types often store them as "boxed" objects such as `java.lang.Integer`.
     
    -This section will discuss how to determine the memory usage of your objects, and how to improve
    -it -- either by changing your data structures, or by storing data in a serialized format.
    -We will then cover tuning Spark's cache size and the Java garbage collector.
    +This section will start with an overview of memory management in Spark, then discuss specific
    +strategies the user can take to make more efficient use of memory in her application. In
    +particular, we will describe how to determine the memory usage of your objects, and how to
    +improve it -- either by changing your data structures, or by storing data in a serialized
    +format. We will then cover tuning Spark's cache size and the Java garbage collector.
    +
    +## Memory Management Overview
    +
    +Memory usage in Spark largely falls into one of two categories: execution and storage.
    +Execution memory refers to that used for computation in shuffles, joins, sorts and aggregations,
    +while storage memory refers to that used for caching and propagating internal data across the
    +cluster. In Spark, execution and storage share a unified region (M). When no execution memory is
    +used, storage can acquire all the available memory and vice versa. Execution may evict storage
    +if necessary, but only until total storage memory usage falls under a certain threshold (R).
    +Storage may not evict execution due to complexities in implementation.
    +
    +This design ensures several desirable properties. First, applications that do not use caching
    +can use the entire space for execution, obviating unnecessary disk spills. Second, applications
    +that do use caching can reserve a minimum storage space (R) where their data blocks are immune
    +to being evicted. Lastly, this approach provides reasonable out-of-the-box performance for a
    +variety of workloads without requiring user expertise of how memory is divided internally.
    +
    +Although there are two relevant configurations, the typical user should not need to adjust them
    +as the default values are applicable to most workloads:
    +
    +* `spark.memory.fraction` expresses the size of `M` as a fraction of the total JVM heap space
    +(default 0.75). This sets aside memory for internal metadata, user data structures, and
    +imprecise size estimation in the case of sparse, unusually large records.
    +* `spark.memory.storageFraction` expresses the size of `R` as a fraction of `M` (default 0.5).
    +This is the amount of storage memory immune to being evicted by execution.
    +
    +For a more detailed description of the model, see the design doc attached to the associated
    --- End diff --
    
    i dont' think you'd want to reference a jira ticket, since it is mutable here ... i'd just remove this line.



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11710] Document new memory management m...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/9676#issuecomment-156568383
  
    Merged build finished. Test PASSed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11710] Document new memory management m...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/9676#issuecomment-156232980
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/45766/
    Test PASSed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11710] Document new memory management m...

Posted by prakashc <gi...@git.apache.org>.
Github user prakashc commented on the pull request:

    https://github.com/apache/spark/pull/9676#issuecomment-156561362
  
    Looks good.
    
    On Fri, Nov 13, 2015 at 1:23 PM, andrewor14 <no...@github.com>
    wrote:
    
    > @prakashc <https://github.com/prakashc> @vidaha
    > <https://github.com/vidaha> Is it clearer now? Any other feedback?
    >
    > —
    > Reply to this email directly or view it on GitHub
    > <https://github.com/apache/spark/pull/9676#issuecomment-156559937>.
    >



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11710] Document new memory management m...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/9676#issuecomment-156559937
  
    @prakashc @vidaha Is it clearer now? Any other feedback?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11710] Document new memory management m...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/9676#issuecomment-156567976
  
    **[Test build #45896 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/45896/consoleFull)** for PR 9676 at commit [`8afd5bd`](https://github.com/apache/spark/commit/8afd5bdb8fe0b66b581e5e90492a40e9d315ae60).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11710] Document new memory management m...

Posted by vidaha <gi...@git.apache.org>.
Github user vidaha commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9676#discussion_r44828509
  
    --- Diff: docs/tuning.md ---
    @@ -88,9 +88,40 @@ than the "raw" data inside their fields. This is due to several reasons:
       but also pointers (typically 8 bytes each) to the next object in the list.
     * Collections of primitive types often store them as "boxed" objects such as `java.lang.Integer`.
     
    -This section will discuss how to determine the memory usage of your objects, and how to improve
    -it -- either by changing your data structures, or by storing data in a serialized format.
    -We will then cover tuning Spark's cache size and the Java garbage collector.
    +This section will start with an overview of memory management in Spark, then discuss specific
    +strategies the user can take to make more efficient use of memory in her application. In
    --- End diff --
    
    her -> the


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11710] Document new memory management m...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/9676#issuecomment-156225663
  
    Merged build started.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11710] Document new memory management m...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9676#discussion_r44834880
  
    --- Diff: docs/tuning.md ---
    @@ -88,9 +88,40 @@ than the "raw" data inside their fields. This is due to several reasons:
       but also pointers (typically 8 bytes each) to the next object in the list.
     * Collections of primitive types often store them as "boxed" objects such as `java.lang.Integer`.
     
    -This section will discuss how to determine the memory usage of your objects, and how to improve
    -it -- either by changing your data structures, or by storing data in a serialized format.
    -We will then cover tuning Spark's cache size and the Java garbage collector.
    +This section will start with an overview of memory management in Spark, then discuss specific
    +strategies the user can take to make more efficient use of memory in her application. In
    --- End diff --
    
    I'll replace this with `his/her`


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11710] Document new memory management m...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/9676#issuecomment-156232818
  
    **[Test build #45766 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/45766/consoleFull)** for PR 9676 at commit [`812f506`](https://github.com/apache/spark/commit/812f506c9e40bbb9dbfccf718a671cc1fdac924c).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11710] Document new memory management m...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/9676#issuecomment-156232976
  
    Merged build finished. Test PASSed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org