Product Documentation

Database Administrator's Guide

Previous Topic

Next Topic

DIAGNOSTICS MEMTRACK

DIAGNOSTICS MEMTRACK

Deprecated: This configuration option enabled the FairCom Server memory tracking feature.

Originally, enabling c-tree Server's memory allocation call stack collection required specifying DIAGNOSTICS MEMTRACK in ctsrvr.cfg because memory allocation call stack collection could increase memory use and slow performance.

An earlier modification made it possible for an administrator to enable and disable memory allocation call stack collection on a per-suballocator list basis at runtime, which meant that the collection was not necessarily a big impact on performance.

The DIAGNOSTICS MEMTRACK configuration option is now deprecated. This is now tracked internally without impact on performance. See the ctstat utility and SnapShot() function memory tracking, in addition to the new HEAP_DEBUG_LEVEL memory tracking.

Behavior Prior to V12

DIAGNOSTICS MEMTRACK increases memory use for each allocation by the size of the MEMALC structure (80 bytes for 32-bit compiles and 152 bytes for 64-bit compiles). The maximum number of stack frames to collect per call stack is set at compile time to MEMSTKLMT, which is defined to 15 in memtrk.c.

If a client attempts to read or log memory statistics using the ctMEMSTAT() API function, however, FairCom DB is running without DIAGNOSTICS MEMTRACK in ctsrvr.cfg, ctMEMSTAT() returns error code FTYP_ERR (53, file mode inconsistent with c-tree config).

Note: This option should be used only when recommended by a FairCom engineering team member as it will impact performance, and the collected data is only meaningful for internal diagnostics. It is included here for completeness.

In V11 and later, the memory allocation tracking feature of FairCom Server is supported on Linux systems. To use this feature, add DIAGNOSTICS MEMTRACK to ctsrvr.cfg.

The MEMTRACK keyword allows the ctstat utility to be used to log current memory allocations to a file. The following parameters can be used with ctstat:

  • -mf logfile - Log all memory allocations to the specified file
  • -ma logfile - Log aggregate memory allocations to the specified file
  • -mr min,max - Log only memory allocations in the range min,max
  • -ms - Output memory allocation statistics

Examples

C:\>ctstat -ms -h 10 -s FAIRCOMS

memseq memalc

1267 992

1289 997

1289 997

1289 997

To log all memory allocations (with each allocation listed separately) to the file memfull.log in the FairCom Server's working directory:

C:\>ctstat -mf memfull.log -i 1 1 -s FAIRCOMS

To log all memory allocations (with allocations having the same call stack listed only once each) to the file memaggr.log in the FairCom Server's working directory:

C:\>ctstat -ma memaggr.log -i 1 1 -s FAIRCOMS

To log all memory allocations that have sequence numbers between 1900 and 2000 to the file memaggr.log in the FairCom Server's working directory:

C:\>ctstat -ma memaggr.log -mr 1900,2000 -i 1 1 -s FAIRCOMS

See Also

DIAGNOSTICS SUBALLOCATOR_OFF

TOCIndex