This story happens after I got some issue when the new Android Studio takes a lot of my memory (8gb of 12gb memory).
it’s not normal with my simple project. I’m trying to adding some custom properties from an official post by google but I feel the ram usage keep higher.
like a normal people, I’m searching on Google…and jump over a post in a website then I found the solution with add “-Xmx2g” on globally variable to limit the JVM to 2gb, you can add the variable based on your OS :
1. ~/.profile(Linux OS)
2. SystemProperties -> System Variable (Windows OS)
if you on linux you can add :
export _JAVA_OPTIONS = “-Xmx2g”
with ‘sudo nano ~/.profile’ from terminal
but if you on windows you can create a new variable :
name = _JAVA_OPTIONS value = -Xmx2 from system variable, don’t forget to reboot your machine and feel the magic, but how do i know its working?
just run the Android Studio from your terminal and take a look if you saw -Xmx2g picked up
