What can i do with Android Studio Virtual Device slow when running and freezing computer when closing?

拟墨画扇 提交于 2020-04-18 03:56:13

问题


When I run the Android Studio AVD that comes with the IDE, the device is a bit slow and when closing the device (with the close icon) the mouse stops moving and the screen starts to flicker (by blinking I mean the Adnroid Studio IDE dissappearing at random intervals), then stops like after two minutes and then the virtual device shuts down.

I have proved with three devices at api 25: Nexus 5 -Nexus 5x -Nexus 4

With Nexus 4 the app is faster, but is the same problem when closing it, it freezes my pc. I do not the causes and makes working with android studio slow and annoying. Today when closing the emulator, it freezes like two minutes and windows 10 gave me a blue screen with the error: Driver Power State Failure.

Any solutions?

My computer specs: -Windows 10 -Intel core 7 -8 ram Gb -64 bits


回答1:


If your android studio gets hang multiple times then you can try this below step : -> Go to help in Android Studio -> click on Edit custom VM Options then Paste Below Text :-

-server
-Xms2G
-Xmx4G
-XX:MaxPermSize=2G
-XX:ReservedCodeCacheSize=1G
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=100
-Djna.debug_load=true
-Djna.debug_load.jna=true
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError

After that restart your android studio and check bottom right side , One indicator is visible for memory usage. If you see that indicator shows more memory , than just click on that indicator its release unused memory from android studio and process will work smoothly.

After follow this step android studio will work smoothly.



来源:https://stackoverflow.com/questions/61219746/what-can-i-do-with-android-studio-virtual-device-slow-when-running-and-freezing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!