Measuring Memory Footprint — Intel® SDE documentation

# Measuring Memory Footprint

The memory footprint analysis tool is an analysis tool that measures the amount of memory used during the application run. It measures the memory at the cache line granularity (each cache line is 64 bytes). Optionally, it can also measure the memory footprint at the page granularity and you need to specify the page size.

Intel® SDE provides two types of memory footprint analysis, the default is throughout the region of interest (defined by the The Controller) or a periodic measurements. The period can be defined in time (wall-clock milliseconds) or by instruction count.

The memory footprint analysis tool is useful for checking if the workload is resident in certain cache level and the developer can update the workload memory footprint size to match the analysis requirements.

    % sde -skx -footprint -- myapp

Will give an output of the form:

    # LEGEND :
    #==========
    # ST = lines (or pages) with STORE only
    # LD = lines (or pages) with LOAD only
    # CD = lines (or pages) with CODE only
    # LD+ST = lines (or pages) with LOAD and SOTRE
    # CD+LD = lines (or pages) with CODE and LOAD
    # CD+ST = lines (or pages) with CODE and STORE
    # C+L+S = lines (or pages) with CODE, LOAD, and STORE
    # NEW = new accesses within interval
    #                   =========================== CACHE LINES ============================
    #  PERIOD[ms]       TID     LOAD   STORE   LD+ST    CODE   CD+LD   CD+ST   C+L+S     NEW
    # THREAD_START 0
            --            0     2745     478     853    1756       4       0       0    5836
            --          all     2745     478     853    1756       4       0       0    5836
    # EOF

Example for periodic footprint analysis:

    % sde -skx -footprint -fp_time 100 -- myapp

Will give an output of the form:

    ...
    #                   =========================== CACHE LINES ============================
    #  PERIOD[ms]       TID     LOAD   STORE   LD+ST    CODE   CD+LD   CD+ST   C+L+S     NEW
    # THREAD_START 0
    # TICK 1
            100           0       16       6      17      21       0       0       0      60
    # TICK 2
            200           0       79       8      13      26       0       0       0     119
    # TICK 3
            300           0       10      13       5      30       0       0       0      43
    # TICK 4
            400           0       27      10      12      25       0       0       0      52

The memory footprint analysis tool knobs:

`-footprint`

  Compute a memory footprint for loads, stores and code references [default 0]

`-footprint_page_size`

  Specify page size (0 means don’t collect pages) [default 0]

`-fp_icount`

  Instructions between working set epochs. 0 means one epoch for whole program [default 0]

`-fp_time`

  Milliseconds between working set epochs. 0 means one epoch for whole program. [default 0]

`-ofootprint`

  Specify output file name [default sde-footprint.txt]