Code example for ActivityManager

Methods: getProcessMemoryInfo

0
	 */ 
	public int getPidMemorySize(int pid, Context context) {
		ActivityManager am = (ActivityManager) context
				.getSystemService(Context.ACTIVITY_SERVICE);
		int[] myMempid = new int[] { pid };
		Debug.MemoryInfo[] memoryInfo = am.getProcessMemoryInfo(myMempid);
		memoryInfo[0].getTotalSharedDirty();
 
		// int memSize = memoryInfo[0].dalvikPrivateDirty; 
		// TODO PSS 
		int memSize = memoryInfo[0].getTotalPss();
		// int memSize = memoryInfo[0].getTotalPrivateDirty(); 
		return memSize;
	} 
 
	/** 
	 * get the sdk version of phone. 
	 *  
	 * @return sdk version 
	 */ 
	public String getSDKVersion() {