memstats

Abstract

Displays statistics describing the memory resources in use by simulation objects. The list is limited to resource use that is on or above the specified kilobyte threshold.

Syntax

memstats [long | delta | diff | kernel | model | catmem | poolmem | general | private] [<kbyte_threshold> | <pattern>]

Argument Type Description
long n/a Display detailed information.
delta n/a Display the memory information as a difference from a previous report.
diff n/a Same as “delta”.
kernel n/a Display only memory allocators defined by the simulation kernel.
model n/a Display only memory allocators defined by models.
catmem n/a Display only categorized memory allocators.
poolmem n/a Display only pooled memory allocators.
general n/a Display only the summary information.
private n/a Display internal kernel entries in addition to others.
<kbyte_threshold> integer Minimum usage threshold for inclusion in the list (the default value is 1 KB).
Memory resource usage by a type of simulation object will be included in the displayed list if it accumulates to more than the specified threshold, in units of kilobytes (KB). A threshold of 5 KB generally filters out “insignificant” memory allocations.
<pattern> string Display only allocators whose name contains <pattern>.

Details

This command displays a tabular list of statistics on static and dynamic simulation objects. (In this context, the term simulation object refers to a broader set than just model objects, and includes internal Simulation Kernel data structures.)

Each row of the table gives statistics for a single simulation object (memory category):

  • Categorized memory types appear by name in separate rows.
  • The row labeled “general” includes internal blocks of uncategorized memory. This memory is not associated with specific objects.
  • The row labeled “other” includes the combined sizes of all memory blocks smaller than the given reporting threshold (<kbyte_threshold>). It also includes all memory blocks internal to the simulation kernel (unless kernel memory is requested, in which case individual categories for memory allocated by the kernel will be reported).

Note: Only total memory usage is reported if the mem_optimize preference is set to FALSE. See “mem_optimize” on page 47 for details.

There are two versions of the table: a default, short format and a long format (specified by the argument “long”) with additional information. The number of columns in each format will vary depending on the types of memory displayed. Depending on the memory category, the following statistics might be displayed:

Table 29: memstats Memory Categories

  • Bytes — Size (in bytes) of an object in the memory pool (used with pooled memory).
  • #Alloc * — Number of times since the start of the program that prg_pmo_alloc() (pooled) is called to allocate memory for single objects or prg_cmo_alloc() (categorized) is called to allocate memory for groups of objects.
  • #Dealloc * — Number of times since the start of the program that op_prg_cmo_dealloc() is called to free memory for groups of objects or prg_mem_free() is called to deallocate memory for groups or single objects.
  • #Use — Number of allocated objects in the category that are currently in use.
  • Use(KB) — Amount of memory (in kilobytes, rounded up) currently used by the allocated objects in the category.
  • #Free * — Number of allocated objects in the category that are not being used. (Used with pooled memory)
  • #Resrv * — Number of objects in the category that are held in reserve, but have not yet been used by the program. (Used with pooled memory)
  • #Total * — Total number of objects currently in the system. (For pooled memory, #Total = #Resv + #Use + #Free, and will always be a multiple of the “increment” argument of prg_pmo_define().)
  • Overhead * — Amount of memory (in kilobytes, rounded up) used for memory headers.
  • Total(KB) * — Amount of memory (in kilobytes, rounded up) currently used by the category. (For pooled memory, Total(KB) = Bytes × #Total / 1024.)

Total(KB) is the most important statistic to watch during debugging. If you capture memory statistics throughout your simulation and notice one particular category rising unexpectedly, this is a good category to investigate for leaks.

Example

(This example lists all objects using on or above 100 KB; because this is a relatively large amount of memory, the number of listed objects is considerably shortened.)

ODB> memstats 100

--------------------------------------------------------------
                Object Allocation Statistics
--------------------------------------------------------------
--------------------------------------------------------------
Memory Pool                Model    Bytes     #Use     Use(KB)
--------------------------------------------------------------
Vos linked list cell           N       12   21,591         254
--------------------------------------------------------------
Total Pooled Memory                                        254
--------------------------------------------------------------

--------------------------------------------------------------
Memory Category            Model              #Use     Use(KB)
--------------------------------------------------------------
Const Strings Hash             N           488,640         478
prg log store                  N                 1       1,025
string data                    N           257,298         252
--------------------------------------------------------------
Total Categorized Memory                                 1,755
--------------------------------------------------------------

--------------------------------------------------------------
Memory Type	                                            Use(KB)
--------------------------------------------------------------
general                                                  2,749
other                                                    5,024
Total Pooled Memory                                        422
Total Categorized Memory                                 1,965
--------------------------------------------------------------
Total                                                   10,160

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com