The point of this thread is to discuss ways of reducing the memory (RAM) usage of individual applications and system processes by
1) identifying and removing applications that use too much memory
2) using alternative applications that use less memory
3) changing system and application settings
This is *not* about using 3rd-party task killer apps, or increasing free memory. Increasing free memory is a different goal, better discussed in the lowmemorykiller thread.
In my experience, getting the memory hogs out of your system is the best way to speed up your phone. If you've ever waited 10 seconds for your home screen to appear after pressing the home button, this is the thread for you.
--Android Process Management--
When you switch away from an Android app, the process is left in memory. Typically such a background process will just be sitting idle, not using any CPU, battery, or network capacity. It's an optimization such that the next time you switch back to that application, it will appear almost instantly, without the overhead of reloading the application and its data from storage. It's akin to minimizing and restoring a Windows application. But eventually Android will be forced to kill idle background processes so as to free memory for new processes. Android will choose a process and ask it to exit, at which point the process will save its state to storage and then exit. The next time you switch to that application, the application and its data will be loaded from storage. What application state information is saved and loaded by the application is defined by the application programmer. Ideally, the application will re-open in a state that is indistinguishable from the old state. But there are applications for which it is not the case, e.g., the Browser, which fetches the last viewed page or the home page upon being reloaded, or Opera Mini, which will say "Loading..." and then present the start page.
How Android decides which process to kill is a topic of discussion in the lowmemorykiller thread. Briefly summarizing: Android divides applications into classes, killing empty apps before unused content providers, before background apps, before visible apps. Within each class, the least recently used processes are killed first.
Reducing the memory usage of individual processes will speed up Android in several ways:
1) Android will have more memory available to keep more background user apps in memory, which will make switching between them faster.
2) Android will spend less time unloading and reloading the kinds of apps that periodically load themselves in the background to do work. Such loading and unloading of background apps impacts the responsiveness of the foreground app.
--How to Monitor Application Memory Usage--
Here is the procedure that I use under CyanogenMod. You can probably do something similar with other ROMs. Connect the phone via USB, run 'adb shell', and then 'top -m 15 -s rss -d 10'. Use the phone for a while, switching between some large apps like the Browser and Google Maps. Observe which processes are staying in memory when you are not actively using them, and which processes periodically load themselves. Note that the USB debugger itself uses some memory.
There are also Android apps that can show you running processes and their memory usage: SystemPanel, or houmiak's Task Manager. I've yet to find one that shows memory usage and automatically refreshes the list of running processes. And I don't understand why the memory usage numbers reported by SystemPanel don't match that reported by Task Manager, top, and ps.
--Memory Hog Apps--
Stays in memory all the time for no apparent reason: Callbook
Stays in memory all the time for possibly good reason: 3G Watchdog, NetCounter, Google Voice, WiSyncPlus, Quick Calendar, Sound Manager, Flex Dialer Lite. It's up to you whether you really want the functionality of such apps, or whether you can live without them or with an alternative.
Loads periodically for no good reason: Amazon MP3 Store, ShopSavvy
Widgets are running programs that are extensions to your home screen. They will be in memory anytime the home screen is visible. I don't know which process hosts widgets (i.e., which PID shows the memory usage of a widget, or of the home screen app itself?) Widgets are great if you need current information displayed, but if you just want the ability to initiate a function from your home screen, a shortcut will do so while using less memory.
--Better Alternative Apps--
Use Andrew Schwimmer's ToggleWifi app (with the monitor feature disabled) instead of a wifi toggle widget. Just create a shortcut to it on your home screen.
Use Volume / Mode Scheduler and/or Timeriffic instead of Sound Manager to control sound settings.
If you use the Google Voice app to redirect outgoing calls, there are alternatives: AccuDial Free is a replacement dialer app, though the interface is bad. Calling Card and CCapp transparently redirect outgoing calls from any dialing app, though so far they only seem to redirect international calls. Write the authors and see if they'll add an option to redirect all calls.
The Smooth Calendar widget seems to use the least amount of memory of all the calendar widgets that I tried.
WiSyncPlus has a lot of great features, but I found that the only functionality I really required - periodically syncing my contacts and calendar - could be achieved by enabling contacts and calendar sync in Android settings, and configuring Timeriffic to turn my WiFi on briefly each day.
APNdroid can enable and disable a GSM data connection. Use a shortcut - not the widget - and disable notifications.
--System Settings to Reduce Memory Usage--
In my experience, disabling Gmail sync speeds up my phone, but I don't really know if this is due to reduced memory usage, or something else. Leaving calendar and contacts sync enabled didn't seem to have an impact. I'm eager to know more about this, and if there are any other settings that can be changed to reduce memory usage of built-in Android and Google processes. I see com.android.inputmethod.latin, com.android.phone, and com.google.process.gapps in memory all the time, and I don't know if or why they need to be. I see media and uploader loading themselves periodically, but I don't know what they do.
--Application Settings to Reduce Memory Usage--
Disable notifications in the CyanogenMod Updater.