Commit 3b1a092
[SPARK-25998][CORE] Change TorrentBroadcast to hold weak reference of broadcast object (apache-spark-on-k8s#469)
… broadcast object
## What changes were proposed in this pull request?
This PR changes the broadcast object in TorrentBroadcast from a strong reference to a weak reference. This allows it to be garbage collected even if the Dataset is held in memory. This is ok, because the broadcast object can always be re-read.
## How was this patch tested?
Tested in Spark shell by taking a heap dump, full repro steps listed in https://issues.apache.org/jira/browse/SPARK-25998.
Closes apache#22995 from bkrieger/bk/torrent-broadcast-weak.
Authored-by: Brandon Krieger <bkrieger@palantir.com>
Signed-off-by: Sean Owen <sean.owen@databricks.com>1 parent 5f701bf commit 3b1a092
File tree
1 file changed
+16
-6
lines changed- core/src/main/scala/org/apache/spark/broadcast
1 file changed
+16
-6
lines changedLines changed: 16 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
66 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | | - | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
| |||
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
97 | | - | |
98 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
99 | 109 | | |
100 | 110 | | |
101 | 111 | | |
| |||
209 | 219 | | |
210 | 220 | | |
211 | 221 | | |
212 | | - | |
213 | | - | |
| 222 | + | |
| 223 | + | |
214 | 224 | | |
215 | 225 | | |
216 | 226 | | |
| |||
0 commit comments