As per the title, my Android Studio seems to be using too much memory, even at idle. For my friend, he is able to run his emulator at only ~300MB of RAM usage, according to Windows' Task Manager. I've tried duplicating his emulator settings, even with his emulator set to 1.5GB of RAM, it is only using about 300MB. Mine goes up to 1.5GB, sometimes even 2GB, just by getting it started, I'm not even running any apps on it.
Is this even possible? Running it at only ~300MB, because on mine, the lowest I can go is 1024MB, setting anything lower results in no change in Task Manager.
Maybe in the installation process you installed more things than him. That's why it's eating a lot more memory
Related
I'm currently working with AOSP and building an app for the Android Automotive OS. I have compiled the same code (checked out from version control) on two different PCs (both running Ubuntu). On one of them (with an Intel CPU) the emulator starts up fine and the emulator is stable.
On the other PC (an AMD CPU) the emulator starts up, but will quickly crash with OutOfMemory errors. AOSP is quickly killing all processes, then its system processes and finally reboots due to 'System is deadlocked on memory'.
I found that the culprit is a system process. It hoards a lot of memory:
the android.hardware.automotive.vehicle process is hoarding memory. It keeps growing very quickly and finally the OS reboots.
When I use the meminfo tool to inspect memory usage of the process, I find the following:
The android.hardware.automotive.vehicle process is using over 2GB of RAM.
My questions thus are:
Do you what is happening?
How can I debug this system process?
Why is the system process behaving differently on one PC compared to another PC?
For those who ran into this issue:
After a lot of fiddling around, I found that adding custom vehicle properties to the VHAL definitions (think of the types.hal and DefaultConfig.h files) must be done very carefully. In my case, I added a vehicle property with VehiclePropertyChangeMode set to CONTINUOUS, but did not add a minimum and maximum sample rate. This caused the android.hardware.automotive.vehicle service to keep requesting more and more memory for some reason and finally the emulator would crash.
If you want to prevent this from happening, make sure to add a minSampleRate and maxSampleRate in your DefaultConfig.h file!
lately I am facing some troubles with my android emulators, some of them start but never work, others start and after several minutes my pc crashes and others do not start at all.
Any solutions? Like turn it off and on? or just restart your computer when something bad happen?
I will appreciate any help!
If your RAM is below 8GB then you want to consider upgrading your
RAM.
Run one emulator at a time. Sometimes you might get frustrated and
therefore starting up two at a time, this will slow down your system
and the emulator performance as well. Solution for this is run a
system task manager check to see all running process then terminate
the unnecessary processes running.
Finally, if the above don't help; I will suggest you download
Bluestack Android Emulator as that is so much kin to work with and
reliable.
Download Bluestack here
My PC is core i-5 with 4gb RAM.
whenever i try to run an AVD in eclipse it comes fast, if i want to run an AVD for TAB it take 5 to 10 minutes. Is there any way to make it fast? Also some time it comes with blackscreen says open gl es API problem type something
Also after fast run, i dont close it, i use it same AVD for all run. But it becames slower after every installation or run by my app. so i have to close and restart my AVD, is there any solution for it. Also some time DDMS cant find AVD, while it was running in font.
Anyone face these problem? any tricks?
one another thing, some time app dont run automatically after installation, i have to select app in AVD's APPS
The Android emulator does not make use of multiple cores. Whether you have 1 or 8 cores doesn't matter. However, the speed of a single core does affect the speed of the emulator.
Having a processor with TurboBoost helps considerably, in my experience. Additionally, it is well known that the 3.X and above emulators are extremely slow by nature.
You could also try allocating more RAM to the AVD in it's setup. Reducing the screen size and resolution also helps in speeding up the emulator.
You can refer to this Google Group thread for details on why the emulator is slow, and how to speed it up.
The emulator comes up but its very unstable. It keeps giving me the window that asks to send data to microsoft. The it becomes not responding and freezes up. Sometimes I might keep it up for a while and am not doing anything to it and all of a sudden it pops up the debug window.
Is there something I can do to make it more stable.
This is specific to your system and the software installed on it. The emulator is rock solid (mostly), so try and solve the problem on your system.
I had such problems when trying to create an emulator with higher resolutions.
Creating a simpler device solved my problem. Probably it was due to my PC specs (P4 2.4 Ghz, 1 GB of RAM).
I have found emulator instances and the AVD manager itself to be VERY flakey.
This is despite re-installs, constant SDK updates and across multiple machines.
Often the only resolution I've found is to delete the AVD that is crashing and recreate it from scratch.
Also make sure you are using the snapshot facility so that you are at least loading fast when it does crash.
I just created a android AVD which runs on the 3.1 version. After it starts running, it takes a lot of time to move from one activity to another. Is there any way I could speed up this process.
Emulators will always run much slower than the devices. Anyhow, the android emulators now are much faster than before, so make sure you keep your sdk updated (and you obviously have, since you're running 3.1).
Also, I consistently noticed that emulators running in ubuntu 11 are faster than the same emulators in Win 7 (same hardware), so you might want to give ubuntu a try.
Android emulator takes a lot of memory while it's starting up. It's normal. The thing you can do here is using a feature called snapshot. Snapshot will save your time (and probably resources) from the start booting up.
Read this article for more details:
Optimizing Apps for Android 3.0
under the "About Emulator Performance" section.
Hope it helps.