0

my system with 4 gb ram, but i use android studio and physical device for testing the apps, android studio keeps not responding with a message this IDE is Runing on low memory , how to fix this , even i dont use any heavy software at the time

  • 1
    Might [this](https://stackoverflow.com/questions/18723755/android-studio-how-to-increase-allocated-heap-size) answer will help you – Ashish Oct 08 '20 at 05:17
  • 1
    4GB RAM is _not_ a development machine. Try switching to something with *at least* 16GB RAM and then adjust Studio memory settings as described below by Rishabh. – Oke Uwechue May 26 '22 at 19:49

2 Answers2

3

4 GB RAM is not a lot for Android studio..8 GB or above is good very good.6 GB is kind of just ok.This is my experince.

What you can do is to improve the Android studio's perfoemance is this :

1.Click File > Settings from the menu bar (or Android Studio > Preferences on macOS). 2.Click Appearance & Behavior > System Settings > Memory Settings. Adjust the heap sizes to match your desired amounts.

Click Apply.

If you changed the heap size for the IDE, you must restart Android Studio before the new memory settings are applied.

Note : Allocating too much memory can degrade performance.but you can increase heap size more with improved performance only if you have a larger RAM or available larger RAM.SO, while you can increase heap size, don't increase a lot.

Rishabh Ritweek
  • 550
  • 3
  • 10
  • 1
    "Adjust the heap sizes to match your desired amounts"? How can a developer have a desired amount of heap space? It's the IDE that complains. And there's no indication why. I used 1280MB for many years and today - out of nowhere - Android Studio complains. I'll ignore the message until I see any real problems... – The incredible Jan Jan 17 '23 at 07:07
2

I was working on a large project and in my case, increasing the -Xmx parameter to 8g helped.

In the case of 4g and even 6g, the android studio froze, in the logs I found: "INFO - .openapi.util.LowMemoryWatcher - Low memory signal received: afterGc = true"

Help -> Edit Custom VM Options

My settings:

-Xms256m
-Xmx8g
-XX: MaxPermSize = 1024m
-XX: ReservedCodeCacheSize = 200m
-XX: + UseCompressedOops