Determining the memory used by a dynamically loaded shared object

Ian Lance Taylor iant@google.com
Tue Aug 11 16:55:00 GMT 2009


David Daney <ddaney@caviumnetworks.com> writes:

> Marcus Clyne wrote:
>> Hi David,
>>
>> Thanks for your quick reply.  Other than forking and exec'ing, is
>> there an easy way of determining this value within a C program?
>>
>
> You could write code (perhaps using something like libelf) to iterate
> through all the LOAD Program Headers, and add up their memory sizes.

You can see those easily enough using "readelf -l".

Ian



More information about the Gcc-help mailing list