Commit f5e4228 1 parent 2b5d6c5 commit f5e4228 Copy full SHA for f5e4228
File tree 1 file changed +7
-0
lines changed
spark/core/src/test/java/zingg/spark/core/session
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -23,13 +23,20 @@ public class SparkSessionProvider {
23
23
private void initializeSession () {
24
24
if (sparkSession == null ) {
25
25
try {
26
+ String sparkDriverMemory = System .getenv ("SPARK_DRIVER_MEMORY" );
27
+ if (sparkDriverMemory == null ) {
28
+ sparkDriverMemory = "1g" ;
29
+ }
26
30
sparkSession = SparkSession
27
31
.builder ()
28
32
.master ("local[*]" )
29
33
.appName ("ZinggJunit" )
30
34
.config ("spark.debug.maxToStringFields" , 100 )
35
+ .config ("spark.driver.memory" , sparkDriverMemory )
31
36
.getOrCreate ();
32
37
SparkContext sparkContext = sparkSession .sparkContext ();
38
+ long driverMemory = sparkContext .getConf ().getSizeAsGb ("spark.driver.memory" , "0" );
39
+ System .out .println ("Spark driver memory: " + driverMemory + " GB" );
33
40
if (sparkContext .getCheckpointDir ().isEmpty ()) {
34
41
sparkContext .setCheckpointDir ("/tmp/checkpoint" );
35
42
}
You can’t perform that action at this time.
0 commit comments