Android Studio RAM usage increases constantly until it maxes out and freezes

First a bit of background:
I’m trying to switch from Windows to Linux. But the only thing stopping me is this problem. First I switched to Solus Linux because I liked the Budgie DE. Solus didn’t have this issue with Android Studio but later I switched to Manjaro KDE like a week ago because it has more software support and customization options.

Problem:
I’m working on the same projects and the same version (latest stable) of Android Studio. Windows is of course a bit slow but doesn’t have the freezing issue. On Manjaro, the IDE freezes when running gradle. I checked the RAM usage from system monitor and there are two Java processes. One of them starts with gradle and increases RAM usage until maxes out (uses around 2.4GB out of my poor 4GB RAM) and freezes everything. I can’t do anything except switching the laptop off using the power button like a monster.

What I tried:

  • Deleting .idea, .gradle, .android and Android Studio config folders
  • Build different projects
  • Invalidate cache and restart
  • Disable all plugins except the built-in ones
  • Installing both JDK 8 and 11
  • Installing snap package and from official website
  • The RAM given to Android Studio is 1300MB on both Manjaro and Windows
  • Almost every solution I could find on Linux forums and Stack Overflow

I’m a Linux noob so please go easy on me. I really wanna switch to Manjaro because Android Studio is too slow on Windows and it takes a lot of time to do my work. :frowning:
Please help

Sounds like a swap issue - maybe missing swap?

1 Like

:+1: Welcome to Manjaro! :+1:

  1. Please read this:
    How to provide good information
    and press the three dots below your post and press the :pencil2: to give us more information so we can see what’s really going on.
    Now we know the symptom of the disease, but we need some more probing to know where the origin lies… :grin:
  2. An inxi --admin --verbosity=7 --filter --no-host --width would be the minimum required information for us to be able to help you. (Personally Identifiable Information like serial numbers and MAC addresses will be filtered out by the above command)
    Also, please copy-paste that output in-between 3 backticks ``` at the beginning and end of the code/text.
  3. Yes, you are a :dragon:! :grin:
    Please read this:
    [HowTo] reboot / turn off your frozen computer: REISUB/REISUO

:+1:

P.S. If you want to notify me that you did provide this information, please :heart: this message and I’ll come back and have another look.

Thanks!
I had the exact same problem. swapon showed that I had no swap partition/file. Following the instructions at Manjaro Wiki - swap I created a 4GB swap file and now the problem that Android Studio freezes the system is gone.

2 Likes

I love it when people read what I wrote!

:+1:

2 Likes