c++data-segment

How to get Data Segment Size in C++


I need to do analysis of memory requirements of one library written in C++, because HW engineers need get some idea about memory requirements of our hardware, there are working on. I can measure heapsize peak, I can measure stack size, but I don't know how to estimate/measure data segment size and Bss size. Is there any method in Visual Studio or GCC? I assume it will differs from compiler to compiler and from platform to platform, but an estimation is fine for me.


Solution

  • During the build:

    Both options generate a map file which will contain the segment sizes.