diff options
author | Sandy Ryza <sandy@cloudera.com> | 2015-05-05 12:38:46 +0100 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2015-05-05 12:38:46 +0100 |
commit | 4222da68dc5360b7a2a8b8bdce231e887ac2f044 (patch) | |
tree | 5a8e81d88f9f7cf000e86e868ef4a924c2c8fddc /docs/tuning.md | |
parent | fc8feaa8e94e1e611d2abb1e5e38de512961502b (diff) | |
download | spark-4222da68dc5360b7a2a8b8bdce231e887ac2f044.tar.gz spark-4222da68dc5360b7a2a8b8bdce231e887ac2f044.tar.bz2 spark-4222da68dc5360b7a2a8b8bdce231e887ac2f044.zip |
[SPARK-5112] Expose SizeEstimator as a developer api
"The best way to size the amount of memory consumption your dataset will require is to create an RDD, put it into cache, and look at the SparkContext logs on your driver program. The logs will tell you how much memory each partition is consuming, which you can aggregate to get the total size of the RDD."
-the Tuning Spark page
This is a pain. It would be much nicer to expose simply functionality for understanding the memory footprint of a Java object.
Author: Sandy Ryza <sandy@cloudera.com>
Closes #3913 from sryza/sandy-spark-5112 and squashes the following commits:
8d9e082 [Sandy Ryza] Add SizeEstimator in org.apache.spark
2e1a906 [Sandy Ryza] Revert "Move SizeEstimator out of util"
93f4cd0 [Sandy Ryza] Move SizeEstimator out of util
e21c1f4 [Sandy Ryza] Remove unused import
798ab88 [Sandy Ryza] Update documentation and add to SparkContext
34c523c [Sandy Ryza] SPARK-5112. Expose SizeEstimator as a developer api
Diffstat (limited to 'docs/tuning.md')
-rw-r--r-- | docs/tuning.md | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/docs/tuning.md b/docs/tuning.md index 1cb223e74f..572c7270e4 100644 --- a/docs/tuning.md +++ b/docs/tuning.md @@ -94,11 +94,13 @@ We will then cover tuning Spark's cache size and the Java garbage collector. ## Determining Memory Consumption -The best way to size the amount of memory consumption your dataset will require is to create an RDD, put it into cache, and look at the SparkContext logs on your driver program. The logs will tell you how much memory each partition is consuming, which you can aggregate to get the total size of the RDD. You will see messages like this: +The best way to size the amount of memory consumption a dataset will require is to create an RDD, put it +into cache, and look at the "Storage" page in the web UI. The page will tell you how much memory the RDD +is occupying. - INFO BlockManagerMasterActor: Added rdd_0_1 in memory on mbk.local:50311 (size: 717.5 KB, free: 332.3 MB) - -This means that partition 1 of RDD 0 consumed 717.5 KB. +To estimate the memory consumption of a particular object, use `SizeEstimator`'s `estimate` method +This is useful for experimenting with different data layouts to trim memory usage, as well as +determining the amount of space a broadcast variable will occupy on each executor heap. ## Tuning Data Structures |