apache spark - Increase memory available to PySpark at runtime -
i'm trying build recommender using spark , ran out of memory:
exception in thread "dag-scheduler-event-loop" java.lang.outofmemoryerror: java heap space
i'd increase memory available spark modifying spark.executor.memory
property, in pyspark, @ runtime.
is possible? if so, how?
update
inspired link in @zero323's comment, tried delete , recreate context in pyspark:
del sc pyspark import sparkconf, sparkcontext conf = (sparkconf().setmaster("http://hadoop01.woolford.io:7077").setappname("recommender").set("spark.executor.memory", "2g")) sc = sparkcontext(conf = conf)
returned:
valueerror: cannot run multiple sparkcontexts @ once;
that's weird, since:
>>> sc traceback (most recent call last): file "<stdin>", line 1, in <module> nameerror: name 'sc' not defined
you set spark.executor.memory
when start pyspark-shell
pyspark --num-executors 5 --driver-memory 2g --executor-memory 2g
Comments
Post a Comment