Detecting memory allocations with Android ddms

To detect memory allocations you use the ddms tool, which is to be found in your Android SDK directory, under /tools. Start ddms by running:
./ddms

I sometimes get the following error when ddms starts:

Could not open Selected VM debug port (8700). Make sure you do not have another instance of DDMS or of the eclipse plugin running. If it’s being used by something else, choose a new port number in the preferences. Continue reading