How to get a task's memory usage in Android?

view story

http://stackoverflow.com – I know how to get memory usage of a process with given pid, but how to get the memory usage of a task? If I understand it correctly, a task/application may have multiple processes. If so, then the question becomes how to know the processes(pids) of a task? (HowTos)