增加Spark shell可用内存

10
我正在尝试在Raspberry Pi1 Model B+上安装Apache Spark。
一旦我打开命令行并尝试使用以下命令:
val l = sc.parallelize(List()).collect

我收到了错误提示:

scala> val l = sc.parallelize(List()).collect
15/03/22 19:52:44 INFO SparkContext: Starting job: collect at <console>:21
15/03/22 19:52:44 INFO DAGScheduler: Got job 0 (collect at <console>:21) with 1 output partitions (allowLocal=false)
15/03/22 19:52:44 INFO DAGScheduler: Final stage: Stage 0(collect at <console>:21)
15/03/22 19:52:44 INFO DAGScheduler: Parents of final stage: List()
15/03/22 19:52:44 INFO DAGScheduler: Missing parents: List()
15/03/22 19:52:44 INFO DAGScheduler: Submitting Stage 0 (ParallelCollectionRDD[0] at parallelize at <console>:21), which has no missing parents
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x9137c074, pid=3596, tid=2415826032
#
# JRE version: Java(TM) SE Runtime Environment (8.0-b132) (build 1.8.0-b132)
# Java VM: Java HotSpot(TM) Client VM (25.0-b70 mixed mode linux-arm )
# Problematic frame:
# C  [snappy-unknown-b62d2fa0-8fdd-4b4b-8c2c-2f24ddaeee74-libsnappyjava.so+0x1074]  _init+0x1a7
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/pi/spark-1.3.0-bin-hadoop2.4/bin/hs_err_pid3596.log
./spark-shell: line 55:  3596 Segmentation fault      "$FWDIR"/bin/spark-submit --class org.apache.spark.repl.Main "${SUBMISSION_OPTS[@]}" spark-shell "${APPLICATION_OPTS[@]}"

启动命令行时,我允许磁盘内存利用:

./spark-shell --conf StorageLevel=MEMORY_AND_DISK

但仍然收到相同的异常。

当启动Spark shell时,有267MB内存可用:

15/03/22 17:09:49 INFO MemoryStore: MemoryStore started with capacity 267.3 MB

这些内存是否足够在shell中运行Spark命令?

下面的命令是否正确启动了将不可用内存溢出到磁盘的Spark shell:./spark-shell --conf StorageLevel=MEMORY_AND_DISK?

更新:

我已经尝试过:

./spark-shell --conf spark.driver.memory=256m

val l = sc.parallelize(List()).collect

但是结果相同

1个回答

12

尝试使用--driver-memory选项设置驱动程序进程的内存。例如:

./spark-shell --driver-memory 2g

需要 2 GB 的内存。


1
谢谢,但如何指示命令行使用MEMORY_AND_DISK? - blue-sky

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接