||11-07-2012 12:45 PM
Originally Posted by yash0307
the virtual pages allocated to it
I'm still not sure whether you mean the total number
of virtual pages or something much more detailed, all the way up to some kind of identification of each virtual page.
Either way, there are some complicated questions about what "allocated" means.
The smaps info gives you quite a lot of detail (but not all the way down to individual pages) about what is mapped in the virtual address space of a process. One conceivable meaning of "allocated" in your question might be everything that is mapped. The total size of all the mappings is the VIRT column in top
and similar tools.
But that is a larger value than what you are likely to think "allocated" means. Mappings may be "demand zero" so the pages don't take up space anywhere (neither on disk nor in ram). Mappings may be "copy on write" so the same physical pages (on disk or in ram) are counted by more than one process even though not shareable. Of course, pages may be shareable and those might or might not actually be shared, so pages may be counted by more than one process without being "copy on write".