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?
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
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.
Clean the cache via this menu:
File -> Invalidate Caches/Restart
and then it should work properly.
This method worked for me after trying many other methods.
1. Update Android SDK tools and latest SDK platform.
2. Remove the Android Studio cache folder situated in C:\users\username\.AndroidStudioPreview2.0
3. Run Android Studio again.
In my case I have been connecting my phone through a VERY long USB extension cable.
Reconnecting device with a short cable solved the issue.
I often switch on "Safe Mode". It disables Syntax check and Inspections, but reduces AS freezing while typing.
IMPORTANT
I notice after I completed the below steps everything worked fine. But after I did a git commit and changed the project folder name, Android Studio froze again. To fix the issue I had to do only step 2 all over again.
I had to do 3 steps (seperately):
When Android Studio first opens, I selected
Android Studio
thenCheck for Updates
When Android Studio first opens, I selected
File
>Invalidate Caches
. In the Invalidate Caches popup tik bothClear file system cache and Local History
andClear VCS Log caches and indexes
then select Invalidate and Restart
- To build on Enes answer to increase the size to 4096, when the Android Studio first opens, on the Welcome screen, select
More Actions
>SDK Manager
. On the next screen, in the left panel, selectMemory Settings
and then on the right panel change the IDEMax heap size
to 4096 MB then selectOK
at the bottom.
© 2022 - 2024 — McMap. All rights reserved.