how to get each android application ram usage?
<p>As shown in the image bellow how do i get the each application ram usage? i have read many posts but still even it says how to get the Dalvik and Nativ memories.</p>

<p>im currently using the following code to generate a list of applications But still couldnt find a way to get the ram usage of each application as shown in the image
process name: com.android.launcher
pid: 124
dalvik private: 1300
dalvik shared: 4024
dalvik pss: 2182
native private: 1856
native shared: 1448
native pss: 1928
other private: 2080
other shared: 992
other pss: 3129
total private dirty memory (KB): 5236
total shared (KB): 6464
total pss: 7239</p>

<p>Using </p>

<pre><code>Context context = this.getApplicationContext();
        ActivityManager mgr = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
        List&lt;RunningAppProcessInfo&gt; processes = mgr.getRunningAppProcesses();
        Log.e("DEBUG", "Running processes:");
        for(Iterator i = processes.iterator(); i.hasNext(); )
        {
        RunningAppProcessInfo p = (RunningAppProcessInfo)i.next();
        Log.e("DEBUG", "  process name: "+p.processName);
        Log.e("DEBUG", "     pid: "+p.pid);                    // process id
        int[] pids = new int[1];
        pids[0] = p.pid;
        android.os.Debug.MemoryInfo[] MI = mgr.getProcessMemoryInfo(pids);
        Log.e("memory","     dalvik private: " + MI[0].dalvikPrivateDirty);
        Log.e("memory","     dalvik shared: " + MI[0].dalvikSharedDirty);
        Log.e("memory","     dalvik pss: " + MI[0].dalvikPss);            
        Log.e("memory","     native private: " + MI[0].nativePrivateDirty);
        Log.e("memory","     native shared: " + MI[0].nativeSharedDirty);
        Log.e("memory","     native pss: " + MI[0].nativePss);            
        Log.e("memory","     other private: " + MI[0].otherPrivateDirty);
        Log.e("memory","     other shared: " + MI[0].otherSharedDirty);
        Log.e("memory","     other pss: " + MI[0].otherPss);

        Log.e("memory","     total private dirty memory (KB): " + MI[0].getTotalPrivateDirty());
        Log.e("memory","     total shared (KB): " + MI[0].getTotalSharedDirty());
        Log.e("memory","     total pss: " + MI[0].getTotalPss());            
         }
</code></pre>

<p><img src="http://i.stack.imgur.com/oxv1C.png" alt="enter image description here"></p>
