Just came across the size command in linux. it takes an executable file as input and prints out the sizes of various memory segments(text,data,bss etc) that the executable uses. Brilliant…. Thanks to this tutorial here(http://www.ualberta.ca/CNS/RESEARCH/LinuxClusters/mem.html). A must read for all beginners to system programming.