Skip to content

Instantly share code, notes, and snippets.

@bhochieng
Created October 6, 2017 11:40
Show Gist options
  • Save bhochieng/92d74f000480cf85ed9f6c0189e0389e to your computer and use it in GitHub Desktop.
Save bhochieng/92d74f000480cf85ed9f6c0189e0389e to your computer and use it in GitHub Desktop.
Android studio hacks and mods for low memory systems
I found that disabling VCS in android studio and using an external program to handle VCS helped a lot. You can disable VCS by going to File->Settings->Plugins and disable the following:
CVS Integration
Git Integration
GitHub
Google Cloud Testing
Google Cloud Tools Core
Google Cloud Tools for Android Studio
hg4idea
Subversion Integration
down vote
Android Studio has recently published an official guide for low-memory machines: Guide
If you are running Android Studio on a machine with less than the recommended specifications (see System Requirements), you can customize the IDE to improve performance on your machine, as follows:
Reduce the maximum heap size available to Android Studio: Reduce the maximum heap size for Android Studio to 512Mb.
Update Gradle and the Android plugin for Gradle: Update to the latest versions of Gradle and the Android plugin for Gradle to ensure you are taking advantage of the latest improvements for performance.
Enable Power Save Mode: Enabling Power Save Mode turns off a number of memory- and battery-intensive background operations, including error highlighting and on-the-fly inspections, autopopup code completion, and automatic incremental background compilation. To turn on Power Save Mode, click File > Power Save Mode.
Disable unnecessary lint checks: To change which lint checks Android Studio runs on your code, proceed as follows: Click File > Settings (on a Mac, Android Studio > Preferences) to open the Settings dialog.In the left pane, expand the Editor section and click Inspections. Click the checkboxes to select or deselect lint checks as appropriate for your project. Click Apply or OK to save your changes.
Debug on a physical device: Debugging on an emulator uses more memory than debugging on a physical device, so you can improve overall performance for Android Studio by debugging on a physical device.
Include only necessary Google Play Services as dependencies: Including Google Play Services as dependencies in your project increases the amount of memory necessary. Only include necessary dependencies to improve memory usage and performance. For more information, see Add Google Play Services to Your Project.
Reduce the maximum heap size available for DEX file compilation: Set the javaMaxHeapSize for DEX file compilation to 200m. For more information, see Improve build times by configuring DEX resources.
Do not enable parallel compilation: Android Studio can compile independent modules in parallel, but if you have a low-memory system you should not turn on this feature. To check this setting, proceed as follows: Click File > Settings (on a Mac, Android Studio > Preferences) to open the Settings dialog. In the left pane, expand Build, Execution, Deployment and then click Compiler. Ensure that the Compile independent modules in parallel option is unchecked.If you have made a change, click Apply or OK for your change to take effect.
Turn on Offline Mode for Gradle: If you have limited bandwitch, turn on Offline Mode to prevent Gradle from attempting to download missing dependencies during your build. When Offline Mode is on, Gradle will issue a build failure if you are missing any dependencies, instead of attempting to download them. To turn on Offline Mode, proceed as follows:
Click File > Settings (on a Mac, Android Studio > Preferences) to open the Settings dialog.
In the left pane, expand Build, Execution, Deployment and then click Gradle.
Under Global Gradle settings, check the Offline work checkbox.
Click Apply or OK for your changes to take effect.
@nazrievfarrukhjon
Copy link

also use nox emulator. it`s very fast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment