Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Need more memory on Android emulator

How do I get more memory on the Android emulator? I've already installed the KitchenSink, and with both that app and my own app - there is nearly zero memory left to run stuff.

I can see in the log that random pids start being dropped due to no memory and then my own app while I'm testing it dies.

What's the process to increase the SD card or whatnot up to 256mgs or higher?

— asked November 6th 2010 by Nathaniel Brown
  • android
  • cache
  • kitchensink
  • memory
  • sd
  • sdcard

2 Answers

  • Hi Nathaniel

    You need to find your android tools directory, and run the "android" executable. You would have possibly already used this to download the Android SDK (on which Titanium Developer is dependent), and in future you will use it to update to new Android releases.

    On my system, the directory is /opt/android-sdk-linux_86/tools, but if you are on a linux system, you may be able to simply type "which android" and its location will be returned.

    Once running, you will see a "Virtual Devices" category on the left which, when clicked, will list the virtual machines that have (typically) automatically been configured by Titanium (the ones with titanium_*) names. Note the name of the one you've been using, delete them all, and recreate an AVD with the parameters (including the SD size) that you need. Then restart TiDev, and launch your app.

    Read more about: AVD

    Alternatively you could hack the script that TiDev uses to create the AVDs. Go to the directory where you usually update your Titanium mobile sdk (the latest builds are available here and change to the SDK your apps are currently using. Then find the android/builder.py script, where you can amend the following line:

    info("Creating shared 64M SD card for use in Android emulator(s)")
    run.run([self.sdk.get_mksdcard(), '64M', self.sdcard])

    Then delete all your AVDs using the AVD tool, restart TiDev and boot your app using the SDK you have amended.

    Obviously with this method you will need to edit the script each time you update the Ti SDK.

    Hope this is useful


    — answered November 6th 2010 by Paul Dowsett
    1 Comment
    • do not use method 1 edit the AVD sdcard size, titanium will install the your app.apk file in the sdcard in a specific location user/.titanium…etc., changing the sdcard size will change the location of the sdcard back to default and titanium will recreate a new one , which is again 64M, so please hack the builder.py in different titanium sdk. And it is much easier as titanium sdk wont' change everyday, while you will change the emulator devices to emulate difference devices, you will have to change many many times once you start a new emulation config. And I do think appcelerator mush add this in tiapp.xml or in titanium studio preference config for easy access.

      — commented August 20th 2012 by Lawrence Cheuk
  • I tried both solutions, I set the SD card to 500M (see below), but I still get "no space left on device" despite my app is below 200mb

    [DEBUG] SDK: /Developer/android-sdk-mac_x86
    [INFO] Creating 500M SD card for use in Android emulator
    [DEBUG] /Developer/android-sdk-mac_x86/tools/mksdcard 500M /Users/myname/.titanium/android2.sdcard

    Any suggestion ?

    — answered September 12th 2011 by Miguel Unamuno
    1 Comment
    • titanium created virtual device ram in phone is only 60MB, even your card is 5000TB, your phone is still 60MB. your have to save downloaded data file to sdcard using Ti.Filesystem.externalStorageDirectory. if your resource fiile but not your downloaded file exceeded 60MB. You must revamp your app, as some old device like HTC is really only 1GB ram, their device already always run of space because the bad developer always put all file there. So be a good developer, separate your app.

      — commented August 20th 2012 by Lawrence Cheuk
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.