Informix

 View Only
  • 1.  monitoring session memory

    Posted Wed February 17, 2021 02:09 PM

    IDS 11.70FC4

    I seem to be having some serious session memory leaks.

    Sadly it is intermittent.

    All the clients are using DBD::Informix (perl) to access the database.

    I have to run onmode -F quite frequently and restart some of the clients so it looks like something is not being closed correctly.

    I'd like to examine the session memory use from inside the session - 
    so we can do things like
    get session size
    execute (for example) a stored procedure
    get session size

    Is there any sql I can run that will return the session memory information like you get from
    onstat -g ses $sessionid?

    TIA




    ------------------------------
    Clive Eisen
    ------------------------------

    #Informix


  • 2.  RE: monitoring session memory

    IBM Champion
    Posted Wed February 17, 2021 08:51 PM


    Try this one:

    > select memused, memtotal from sysscblst where sid = 503;

       memused    memtotal
        252728      266240

    1 row(s) retrieved.

    Slightly different from the onstat output, but consistent:

    onstat -g ses 503 | head -7

    IBM Informix Dynamic Server Version 14.10.FC5DE -- On-Line -- Up 11:10:30 -- 2180172 Kbytes 2021-02-17 20:48:18
    session           effective                             #RSAM    total      used       dynamic
    id       user     user      tty      pid      hostname  threads  memory     memory     explain
    503      art      -         5        206295   localhost 1        245760     225384     off



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 3.  RE: monitoring session memory

    Posted Thu February 18, 2021 04:44 AM
    Too kind Art.

    Long time no see.

    Regards,

    ------------------------------
    Clive Eisen
    ------------------------------



  • 4.  RE: monitoring session memory

    IBM Champion
    Posted Thu February 18, 2021 05:42 AM
    Long time no see anyone these days!  B^(

    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 5.  RE: monitoring session memory

    Posted Thu February 18, 2021 09:44 AM
    Sadly true - maybe one day.

    ------------------------------
    Clive Eisen
    ------------------------------



  • 6.  RE: monitoring session memory

    Posted Thu February 18, 2021 01:44 PM
    Clive

    When investigating a suspected memory leak, I run something like this...

    for i in $(onstat -g ses | grep -v informix | awk '{print $8":"$5":"$1}' | sort -nr | head -5)
    do
       sessID=$(echo $i | cut -d ":" -f 3)
       onstat -g ses $sessID
    done >> /tmp/mySessIDs.txt

    ...and that gives me the onstat  -g ses output for the top 5 memory hungry user sessions.

    I'm not touching the system tables, but it's useful when you don't know which sessions to initially target.


    ------------------------------
    Kirit Rana
    ------------------------------



  • 7.  RE: monitoring session memory

    IBM Champion
    Posted Thu February 18, 2021 01:54 PM

    Onstat –g afr can be useful as well