Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resolving problems with Android Studio freezing constantly

I have 8GB of RAM and 500GB hard disk but when I am using Android Studio it still freezes so much that I am unable to do my work. I have reinstalled the software without any improvement. I also formatted my system and reinstalled Android Studio again but nothing works. Can anyone tell me what can be a possible solution to this?

like image 237
Nishtha Avatar asked Aug 31 '25 21:08

Nishtha


2 Answers

In android studio application package content, edit studio.vmoptions file and increase "-Xms" and "-Xmx" parameters like

-Xms1024m
-Xmx4096m

UPDATE

I figured out that idea is getting error while writing or reading cache (from idea.log)

WARN - .caches.project.IdeaModuleInfo - Could not find correct module information. Reason: Analyzing element of type class com.android.tools.idea.databinding.LightGeneratedComponentClass with no containing file Text: null

Every time when android studio freezes, I delete .idea/caches/ in project folder so it fixes freeze problem temporary

like image 58
Enes Avatar answered Sep 03 '25 09:09

Enes


in my case, noticed that the number of "Recent hangs" of Android Studio was constantly increasing, and unplugged the USB cable which connected an Android phone for debugging did solve my problem.

like image 28
Neil.Ling Avatar answered Sep 03 '25 11:09

Neil.Ling