• Register
Welcome to Kodlogs, programming questions and answer website.
0 votes
error occurred during initialization of vm could not reserve enough space for 2097152kb object heap
by (5.3k points)  
retagged by

1 Answer

0 votes


In this answer we are going to see reasons for not enough space of heap issues



With Java version using x86 under windows, you might get error when attempting to allocate 2GB when connecting to Spark:

---- Output Log ----

Error occurred during initialization of VM

Could not reserve enough space for 2097152KB object heap



 (1)You need to reduce default memory

config <- spark_config()

config[["sparklyr.shell.driver-memory"]] <- "512m"

sc <- spark_connect(master = "local", config = config)

(2) Install Java x64

by (1.6k points)