Do you know you can earn heaps of $$ by answering questions on kodlogs, for more info contact us through feedback link at footer? We are Australian based web site and pay you for answering questions

  • Register
Welcome to Kodlogs Q&A, where you can ask programming questions and receive answers from other members of the community. For programmers, by programmers Kodlogs is an open community for anyone that does coding. We help you get answers to your toughest coding questions, share knowledge with your coworkers in private, and find your next IT dream job.
0 votes
error occurred during initialization of vm could not reserve enough space for 2097152kb object heap
by (2.7k 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[[""]] <- "512m"

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

(2) Install Java x64

by (1.4k points)