Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio spawning multiple java processes! How to minimize its memory usage on a low-ram machine?

I'm running Android Studio on an underpowered machine, and when I was monitoring Android Studio's memory consumption I noticed multiple "java" processes, some even forking another process as a child and some taking as much as up to 1 GB!

Is this normal behavior or is it the result of a misconfiguration?

And how can I configure this to work with less number of java processes?

Will changing the project's JDK and Gradle to an externally installed (more recent version) help rather than using the ones shipped with Android Studio?

Android Studio and Java Compiler Memory Usage

like image 527
HumbleBee Avatar asked Feb 04 '20 13:02

HumbleBee


People also ask

How do I free up memory on Android studio?

Steps 1 enable memory view(if not done yet):Go to preferences(command+,) Search for memory. Inside Appearance & Behavior -> Appearance-> Window options -> enable show Memory indicator.

Does Android Studio use a lot of memory?

1–1.5 gb will be consumed by most of your OS and processes running parallely. So with android studio basically you'll see that 80–85% ram is being used if you have 4gb ram. In case of 8gb it's more than enough.

What is XMX setting in Android Studio?

Xmx specifies the maximum memory allocation pool for a Java Virtual Machine (JVM), while Xms specifies the initial memory allocation pool. Your JVM will be started with Xms amount of memory and will be able to use a maximum of Xmx amount of memory. Save the studio.


1 Answers

As @PiPRocks said, using Android Studio on an underpowered machine is almost impractical.

For smooth working of Android Studio your machine should have atleast 8GB of RAM and if it has a GPU it adds up but is not necessary.

Coming to Your Question...

This is normal behaviour of Android Studio. It keeps the IDE process and Gradle process separate (with the name of 'java'). And if you are running an Emulator, you'll see another process.

like image 55
Rohit Rawat Avatar answered Oct 31 '22 18:10

Rohit Rawat