Android studio does not free java memory - android-studio

Every time I make my project (Build -> Make project) or run my app (Run -> Run 'app') java memory increase and it is never released.
After 10 builds the memory is almost in 1GB and every 30 minutes I need to force java to close:
What am I missing? My android studio is 1.1.0.

Related

Android Studio Bumblebee crashes frequently

I am wondering if anyone else has encountered this problem and figured a way to deal with it.
Android Studio Bumblebee crashes randomly and frequently. There is no pattern. It crashes when I do something (e.g., editing code) or sometimes when I do nothing. It can crash soon after I start AS or after I use it for a little while. It crashes once every hour or so on average.
Are there any parameters that I can change to make AS stabler? Is there a good way to diagnose the crash?
I usually have over a dozen programs running on the same computer (Visual Studio, Outlook, browsers...). AS is the only program that crashes. All others work fine.
Android Studio Bumblebee | 2021.1.1
Build #AI-211.7628.21.2111.8092744, built on January 19, 2022
Runtime version: 11.0.11+9-b60-7590822 amd64
VM: OpenJDK 64-Bit Server VM by Oracle Corporation
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 16
Registry: external.system.auto.import.disabled=true, debugger.watches.in.variables=false
Non-Bundled Plugins: com.intellij.marketplace (211.7628.36), com.thoughtworks.gauge (211.6693.111), org.jetbrains.kotlin (211-1.6.10-release-923-AS7442.40), com.android.aas (3.5.1), com.google.mad-scorecard (1.2), org.intellij.plugins.markdown (211.7142.37)
I faced the same issue until I disabled the Launch in tool window. Just go to File -> Settings -> Tools -> Emulator and disable the launch in a tool window checkbox.

installing any sdk platform for android studio takes very long time

I totally beginner in regards to android apps and android studio and I am trying to learn Kotlin and for that I installed Android studio on Ubuntu 18.04 but when trying to install any sdk platform it takes very very long time to complete installing ( the window indicate "installing XXXX" ) is there any way to speed up the installing?
for example Installing Android SDK Platform 24 takes too long
My laptop specs:
core i7
8GB RAM
Getting set up with Android Studio can take a while, usually the download takes the longest time. Expect to download 1-2 GB. You definitely don't need all the SDK platforms, only the latest (currently 28), and you don't need the NDK platform either (unless you're writing in C/C++, which if you're new to Android development is unlikely). You can also avoid downloading an emulator image by just running your app on a real device.
Try going for the minimum amount of things you need to install to get a basic "Hello World!" app running, Android Studio will prompt you if you need to download anything else.
It could also be that your computer is struggling with its memory limits; 8GB of RAM can be tight if you have other programs running on your laptop as IDEs tend to be pretty heavy. Consider upgrading your RAM if you're serious about Android development, 16GB is usually plenty.

Android Studio Excessive Memory Consumption without releasing

I noticed that when doing builds with Android Studio my system's memory usage increases until I restart Android Studio.
Each build increases a little bit more up to the 16GB of my system. At the end I need to restart AS.
I am running Android Studio 3.0.1 on Linux Mint 18.1., 16GB RAM.
I noticed this with and without emulator

Sluggish Android Studio Start up

I have Android Studio 3.0.1 with latest JDK installed on my i7 (4th Gen) dual core Win10 machine, 16GB RAM, 850 Pro 512GB SSD. But even with this beastly configuration, when double clicking on the Android Studio icon to launch the application, the software feels very sluggish in starting up. Takes approx. 15-20 odd seconds to just start up and then do the Gradle build of last opened app, which takes another 30-40 seconds.
Have set the vmoptions & gradle.properties to use -Xms2g and -Xmx4g along with parallel build, offline gradle execution and configureondemand.
Is there a way to drastically improve this performance when I have such a good machine configuration, probably tweaking some other Windows / Android Studio level parameters? Please help.
It start in seconds only because of that configuration.It takes few minutes to start in my laptop with 8gb ram.
So the time you mentioned seems pretty good.

Visual Studio 2012 Memory Spike and Hanging

Recently, Visual Studio 2012 has been acting up. As I'm developing ASP .NET applications I routinely tab between the browser (Chrome) and the Visual Studio IDE. Sometimes when I attempt to tab back into Visual Studio the window will not come up. At that time if I look at my task manager I'll see that the devenv.exe process is using about 10 to 20% of CPU time and is gathering more and more memory for itself. This goes on for about 20 seconds or so before the IDE is responsive and usable again. Eventually, the IDE can't recover and I need to terminate the process.
My desktop is a 64-bit quad-core i7 # 3.4GHz with 8 GB of RAM, running Windows 7 OS. Typically devenv.exe will use about 500 MB of RAM. When the problem above begins to happen it will quicky ramp up to 1.5 GB and has been as high as 2 GB.
The only add-on I'm using is ReSharper 7.1. I have no further IDE customizations apart from the built-in dark color scheme.
EDIT — I have tried disabling and removing R# which has had no effect on this problem.
EDIT — Bug report on Microsoft Connect
I used to have this all the time until I installed VS 2012 update 4 then it all went away.
I also only use resharper ( version 8).

Resources