Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native eror "Could not reserve enough space for 2097152KB object heap"

Tags:

react-native

I am working with React Native and trying to create a debug build, or trying to load the build in emulator using "react-native run-anroid" command. I am getting the following error:

Error occurred during initialization of VM Could not reserve enough space for 2097152KB object heap Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0

See the screenshot below:

enter image description here

How can I resolve this error?

like image 641
Vishal Pachpande Avatar asked Sep 15 '25 16:09

Vishal Pachpande


1 Answers

Comment below line in gradle.properties inside android folder using #

org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

To

  #  org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
like image 119
Moumit Avatar answered Sep 18 '25 09:09

Moumit