InformixHQ - MemorySegments Sensor
Posted in 2025
Topics: General Discussion
I'd like to monitor the virtual memory segment (V class). But I can't understand these sensor metrics. ------------------------------ Leandro Kohler ------------------------------
Hi Leandro.
Those metrics will correspond this output:
$ onstat -g seg
IBM Informix Dynamic Server Version 14.10.FC11DE -- On-Line -- Up 19 days 00:01:04 -- 998696 KbytesSegment Summary:
id key addr size ovhd class blkused blkfree
1 52564801 44000000 31272960 807880 R* 7635 0
2 52564802 45dd3000 536870912 6293160 V* 18523 112549
3 52564803 65dd3000 453959680 1 B* 110830 0
5 52564805 80fc1000 561152 7848 M 136 1
Total: - - 1022664704 - - 137124 112550
(* segment locked in memory)
"size" and "ovhd" are in bytes whereas the last two columns are in 4-KB blocks. I have no idea what HQ returns, so please compare with the above command on your Informix instance.
------------------------------
Doug Lawry
Oninit Consulting
------------------------------
Leandro:
Doug covered the onstat interface to your memory segments, here is info about using the sysmaster tables for this:
The table sysmaster:sysseglst lists the shared memory segments and details about them. Here is the schema from the file $INFORMIXDIR/etc/sysmaster.sql which is used to create/recreate sysmaster:
create table informix.sysseglst { Internal Use Only }
(seg_address int8, { address of segment structure }
seg_next int8, { pointer to next segment }
seg_prev int8, { pointer to prev segment }
seg_class smallint, { segment class }
seg_size int8, { size of this segment }
seg_osshmid integer, { id of this OS segment in this seg}
seg_osmaxsize int8, { size of maximum OS segment in this seg}
seg_osshmkey integer, { shmkey for first OS segment }
seg_procid integer, { process id of creator }
seg_userid smallint, { usr id of creator }
seg_shmaddr int8, { address of segment }
seg_ovhd int8, { amount of overhead bytes }
seg_lock int8, { lock to synchronise bitmap access}
seg_nextid integer, { segment id of next seg }
seg_bmapsz int8, { size of block map }
seg_blkused int8, { no. of used blocks in segment }
seg_blkfree int8 { no. of free blocks in segment }
);
So, you are most interested in these columns: seg_size, seg_blkused, seg_blkfree. and seg_class.
The seg_class values correspond to the class column in the onstat -g seg output with:
1 - R(esident) - the main data structure headers and some fixed data structures
2 - V(irtual) - the memory used by server sessions and variable data structures
3 - B(uffer) - the buffer caches
4 - M(emory communication) - memory used for shared memory connections
There are other classes, but these are the most common.
The seg_osshmid and seg_osshmkey values correspond to the id and key values displayed by the OS command ipcs -m (though the shmkey is displayed in hex there). The seg_blkused and seg_blkfree are in blocks of 4096 bytes where the seg_size is in bytes.
Art
------------------------------
Art S. Kagel, President and Principal Consultant
ASK Database Management Corp.
www.askdbmgt.com
------------------------------