Is gradually increasing memory in long running session normal?

Ask a Question related to Informix, Design and Development.

  1. #1

    Default Is gradually increasing memory in long running session normal?

    I've been trying to debug a problem with a constantly running
    application that is
    experiencing a performance degradation over time. Today I set up a
    script to
    run onstat -g ses every 60 seconds and log the results. One of the
    things that caught my eye is that this session's memory use increases
    constantly over time.
    For example,

    total
    memory
    13:38 1265664
    14:38 1977408
    15:38 2646016

    Will the total memory ever decrease during the lifespan of a session?

    Dave Thacker
    Dave Thacker Guest

  2. Similar Questions and Discussions

    1. ID1.0 not running under normal user rights
      Hello all, its perplexing. Photoshop 7, illustrator all run when installed under admin rights and run under 'normal' user privileges. But...
    2. Long-running daemon acquiring giant memory footprint
      I have written a long-running daemon in ruby to handle dynamic DNS updates. I have just recently moved it from ruby 1.6 to ruby 1.8 and updated all...
    3. #24148 [Opn->WFx]: increasing memory usage
      ID: 24148 Updated by: sniper@php.net Reported By: ardo at np dot ee -Status: Open +Status: Wont fix...
    4. #24148 [NoF->Opn]: increasing memory usage
      ID: 24148 User updated by: ardo at np dot ee Reported By: ardo at np dot ee -Status: No Feedback +Status: ...
    5. #24148 [Fbk->NoF]: increasing memory usage
      ID: 24148 Updated by: sniper@php.net Reported By: ardo at np dot ee -Status: Feedback +Status: No...
  3. #2

    Default Re: Is gradually increasing memory in long running session normal?


    Hi Dave:

    Several months ago one of ours 4GL programs made a lot of DECLARE
    CURSOR/PREPARE without FREEing them, and yes the memory usage was
    increasing.

    In my case I use onstat -g stm to locate the statements prepared, fgrep the
    source to locate the offending code and adding the missing FREE .

    HTH

    ----- Original Message -----
    From: <dthacker@omnihotels.com>
    To: <informix-list@iiug.org>
    Sent: Thursday, September 04, 2003 3:55 PM
    Subject: Is gradually increasing memory in long running session normal?

    > I've been trying to debug a problem with a constantly running
    > application that is
    > experiencing a performance degradation over time. Today I set up a
    > script to
    > run onstat -g ses every 60 seconds and log the results. One of the
    > things that caught my eye is that this session's memory use increases
    > constantly over time.
    > For example,
    >
    > total
    > memory
    > 13:38 1265664
    > 14:38 1977408
    > 15:38 2646016
    >
    > Will the total memory ever decrease during the lifespan of a session?
    >
    > Dave Thacker
    sending to informix-list
    Fernando Ortiz Guest

  4. #3

    Default Re: Is gradually increasing memory in long running session normal?

    Hi Fernando,

    I changed our programs to prepare lots of heavily used statements
    instead of redeclaring the cursors.

    At least in one case it took me several months to identify one prepared
    statement which wouldn't free the allocated memory. I used the following
    identical syntax for several SQL-statements:

    let query = "select ..."
    prepare query_prep from query
    declare query_curs cursor for query_prep
    free query_prep

    This works for all but one function. The memory only gets released if
    the program ends. After rewriting the code and declaring the cursor
    every time it's used, everything works fine.

    Can anyone corfirm this?

    We're using 4GL RDS 7.30UC6 with IDS 7.30UC10 on SCO Unixware 7.1.1 and this
    was reproducable on RedHat Linux 7.3 4GL RDS 7.30UC5 and IDS 7.30UC10.


    --
    Roland Wintgen (Systemadministrator)

    EVG Elektro-Vertriebs-Gesellschaft Martens GmbH & Co KG
    Trompeterallee 244-246, D-41189 Moenchengladbach
    phone +49 21 66 / 55 08 23, fax +49 21 66 / 55 08 90
    [url]www.evg.de[/url] [email]rw@evg.de[/email]


    Fernando Ortiz wrote:
    > Hi Dave:
    >
    > Several months ago one of ours 4GL programs made a lot of DECLARE
    > CURSOR/PREPARE without FREEing them, and yes the memory usage was
    > increasing.
    >
    > In my case I use onstat -g stm to locate the statements prepared, fgrep the
    > source to locate the offending code and adding the missing FREE .
    >
    > HTH
    >
    > ----- Original Message -----
    > From: <dthacker@omnihotels.com>
    > To: <informix-list@iiug.org>
    > Sent: Thursday, September 04, 2003 3:55 PM
    > Subject: Is gradually increasing memory in long running session normal?
    >
    >
    >
    >>I've been trying to debug a problem with a constantly running
    >>application that is
    >>experiencing a performance degradation over time. Today I set up a
    >>script to
    >>run onstat -g ses every 60 seconds and log the results. One of the
    >>things that caught my eye is that this session's memory use increases
    >>constantly over time.
    >>For example,
    >>
    >> total
    >> memory
    >>13:38 1265664
    >>14:38 1977408
    >>15:38 2646016
    >>
    >>Will the total memory ever decrease during the lifespan of a session?
    >>
    >>Dave Thacker
    >
    >
    > sending to informix-list
    Roland Wintgen Guest

  5. #4

    Default Re: Is gradually increasing memory in long running session normal?


    Hi Roland:

    In our programs we also FREE the cursor

    let query = "select ..."
    prepare query_prep from query
    declare query_curs cursor for query_prep
    ... open query_curs or foreach query_curs
    ...
    ... free query_curs
    free query_prep

    I use 4GL RDS 7.30UC7, IDS 9.30UC2, On RedHat Linux 7.2

    ----- Original Message -----
    From: "Roland Wintgen" <rw@evg.de>
    To: <informix-list@iiug.org>
    Sent: Friday, September 05, 2003 5:40 AM
    Subject: Re: Is gradually increasing memory in long running session normal?

    > Hi Fernando,
    >
    > I changed our programs to prepare lots of heavily used statements
    > instead of redeclaring the cursors.
    >
    > At least in one case it took me several months to identify one prepared
    > statement which wouldn't free the allocated memory. I used the following
    > identical syntax for several SQL-statements:
    >
    > let query = "select ..."
    > prepare query_prep from query
    > declare query_curs cursor for query_prep
    > free query_prep
    >
    > This works for all but one function. The memory only gets released if
    > the program ends. After rewriting the code and declaring the cursor
    > every time it's used, everything works fine.
    >
    > Can anyone corfirm this?
    >
    > We're using 4GL RDS 7.30UC6 with IDS 7.30UC10 on SCO Unixware 7.1.1 and
    this
    > was reproducable on RedHat Linux 7.3 4GL RDS 7.30UC5 and IDS 7.30UC10.
    >
    >
    > --
    > Roland Wintgen (Systemadministrator)
    >
    > EVG Elektro-Vertriebs-Gesellschaft Martens GmbH & Co KG
    > Trompeterallee 244-246, D-41189 Moenchengladbach
    > phone +49 21 66 / 55 08 23, fax +49 21 66 / 55 08 90
    > [url]www.evg.de[/url] [email]rw@evg.de[/email]
    >
    >
    > Fernando Ortiz wrote:
    > > Hi Dave:
    > >
    > > Several months ago one of ours 4GL programs made a lot of DECLARE
    > > CURSOR/PREPARE without FREEing them, and yes the memory usage was
    > > increasing.
    > >
    > > In my case I use onstat -g stm to locate the statements prepared, fgrep
    the
    > > source to locate the offending code and adding the missing FREE .
    > >
    > > HTH
    > >
    > > ----- Original Message -----
    > > From: <dthacker@omnihotels.com>
    > > To: <informix-list@iiug.org>
    > > Sent: Thursday, September 04, 2003 3:55 PM
    > > Subject: Is gradually increasing memory in long running session normal?
    > >
    > >
    > >
    > >>I've been trying to debug a problem with a constantly running
    > >>application that is
    > >>experiencing a performance degradation over time. Today I set up a
    > >>script to
    > >>run onstat -g ses every 60 seconds and log the results. One of the
    > >>things that caught my eye is that this session's memory use increases
    > >>constantly over time.
    > >>For example,
    > >>
    > >> total
    > >> memory
    > >>13:38 1265664
    > >>14:38 1977408
    > >>15:38 2646016
    > >>
    > >>Will the total memory ever decrease during the lifespan of a session?
    > >>
    > >>Dave Thacker
    > >
    > >
    > > sending to informix-list
    sending to informix-list
    Fernando Ortiz Guest

  6. #5

    Default Re: Is gradually increasing memory in long running session normal?


    "Roland Wintgen" <rw@evg.de> wrote in message
    news:3F586828.2010002@evg.de...
    > Hi Fernando,
    >
    > I changed our programs to prepare lots of heavily used statements
    > instead of redeclaring the cursors.
    >
    > At least in one case it took me several months to identify one prepared
    > statement which wouldn't free the allocated memory. I used the following
    > identical syntax for several SQL-statements:
    >
    > let query = "select ..."
    > prepare query_prep from query
    > declare query_curs cursor for query_prep
    free query_curs
    > free query_prep
    >
    > This works for all but one function. The memory only gets released if
    > the program ends. After rewriting the code and declaring the cursor
    > every time it's used, everything works fine.
    >
    free the cursor as well (before the prepared query!
    > Can anyone corfirm this?
    >
    > We're using 4GL RDS 7.30UC6 with IDS 7.30UC10 on SCO Unixware 7.1.1 and
    this
    > was reproducable on RedHat Linux 7.3 4GL RDS 7.30UC5 and IDS 7.30UC10.
    >
    >
    > --
    > Roland Wintgen (Systemadministrator)
    >
    > EVG Elektro-Vertriebs-Gesellschaft Martens GmbH & Co KG
    > Trompeterallee 244-246, D-41189 Moenchengladbach
    > phone +49 21 66 / 55 08 23, fax +49 21 66 / 55 08 90
    > [url]www.evg.de[/url] [email]rw@evg.de[/email]
    >
    >
    > Fernando Ortiz wrote:
    > > Hi Dave:
    > >
    > > Several months ago one of ours 4GL programs made a lot of DECLARE
    > > CURSOR/PREPARE without FREEing them, and yes the memory usage was
    > > increasing.
    > >
    > > In my case I use onstat -g stm to locate the statements prepared, fgrep
    the
    > > source to locate the offending code and adding the missing FREE .
    > >
    > > HTH
    > >
    > > ----- Original Message -----
    > > From: <dthacker@omnihotels.com>
    > > To: <informix-list@iiug.org>
    > > Sent: Thursday, September 04, 2003 3:55 PM
    > > Subject: Is gradually increasing memory in long running session normal?
    > >
    > >
    > >
    > >>I've been trying to debug a problem with a constantly running
    > >>application that is
    > >>experiencing a performance degradation over time. Today I set up a
    > >>script to
    > >>run onstat -g ses every 60 seconds and log the results. One of the
    > >>things that caught my eye is that this session's memory use increases
    > >>constantly over time.
    > >>For example,
    > >>
    > >> total
    > >> memory
    > >>13:38 1265664
    > >>14:38 1977408
    > >>15:38 2646016
    > >>
    > >>Will the total memory ever decrease during the lifespan of a session?
    > >>
    > >>Dave Thacker
    > >
    > >
    > > sending to informix-list
    >

    David Williams Guest

  7. #6

    Default Re: Is gradually increasing memory in long running session normal?

    Fernando Ortiz wrote:
    > Hi Roland:
    >
    > In our programs we also FREE the cursor
    >
    > let query = "select ..."
    > prepare query_prep from query
    > declare query_curs cursor for query_prep
    > ... open query_curs or foreach query_curs
    > ...
    > ... free query_curs
    > free query_prep
    >
    > I use 4GL RDS 7.30UC7, IDS 9.30UC2, On RedHat Linux 7.2
    >
    Sure, but this way I have to reprepare the statement to use it again.
    And that's no advantage instead of redeclaring the cursor everytime
    it's needed.
    > ----- Original Message -----
    > From: "Roland Wintgen" <rw@evg.de>
    > To: <informix-list@iiug.org>
    > Sent: Friday, September 05, 2003 5:40 AM
    > Subject: Re: Is gradually increasing memory in long running session normal?
    >
    >
    >
    >>Hi Fernando,
    >>
    >>I changed our programs to prepare lots of heavily used statements
    >>instead of redeclaring the cursors.
    >>
    >>At least in one case it took me several months to identify one prepared
    >>statement which wouldn't free the allocated memory. I used the following
    >>identical syntax for several SQL-statements:
    >>
    >>let query = "select ..."
    >>prepare query_prep from query
    >>declare query_curs cursor for query_prep
    >>free query_prep
    >>
    >>This works for all but one function. The memory only gets released if
    >>the program ends. After rewriting the code and declaring the cursor
    >>every time it's used, everything works fine.
    >>
    >>Can anyone corfirm this?
    >>
    >>We're using 4GL RDS 7.30UC6 with IDS 7.30UC10 on SCO Unixware 7.1.1 and
    >
    > this
    >
    >>was reproducable on RedHat Linux 7.3 4GL RDS 7.30UC5 and IDS 7.30UC10.
    >>
    >>
    >>--
    >> Roland Wintgen (Systemadministrator)
    >>
    >> EVG Elektro-Vertriebs-Gesellschaft Martens GmbH & Co KG
    >> Trompeterallee 244-246, D-41189 Moenchengladbach
    >> phone +49 21 66 / 55 08 23, fax +49 21 66 / 55 08 90
    >> [url]www.evg.de[/url] [email]rw@evg.de[/email]
    >>
    >>
    >>Fernando Ortiz wrote:
    >>
    >>>Hi Dave:
    >>>
    >>>Several months ago one of ours 4GL programs made a lot of DECLARE
    >>>CURSOR/PREPARE without FREEing them, and yes the memory usage was
    >>>increasing.
    >>>
    >>>In my case I use onstat -g stm to locate the statements prepared, fgrep
    >
    > the
    >
    >>>source to locate the offending code and adding the missing FREE .
    >>>
    >>>HTH
    >>>
    >>>----- Original Message -----
    >>>From: <dthacker@omnihotels.com>
    >>>To: <informix-list@iiug.org>
    >>>Sent: Thursday, September 04, 2003 3:55 PM
    >>>Subject: Is gradually increasing memory in long running session normal?
    >>>
    >>>
    >>>
    >>>
    >>>>I've been trying to debug a problem with a constantly running
    >>>>application that is
    >>>>experiencing a performance degradation over time. Today I set up a
    >>>>script to
    >>>>run onstat -g ses every 60 seconds and log the results. One of the
    >>>>things that caught my eye is that this session's memory use increases
    >>>>constantly over time.
    >>>>For example,
    >>>>
    >>>> total
    >>>> memory
    >>>>13:38 1265664
    >>>>14:38 1977408
    >>>>15:38 2646016
    >>>>
    >>>>Will the total memory ever decrease during the lifespan of a session?
    >>>>
    >>>>Dave Thacker
    >>>
    >>>
    >>>sending to informix-list
    >
    >
    > sending to informix-list
    --
    Roland Wintgen (Systemadministrator)

    EVG Elektro-Vertriebs-Gesellschaft Martens GmbH & Co KG
    Trompeterallee 244-246, D-41189 Moenchengladbach
    phone +49 21 66 / 55 08 23, fax +49 21 66 / 55 08 90
    [url]www.evg.de[/url] [email]rw@evg.de[/email]

    Roland Wintgen Guest

  8. #7

    Default Re: Is gradually increasing memory in long running session normal? (Resolved)

    [email]dthacker@omnihotels.com[/email] (Dave Thacker) wrote in message news:<554c618d.0309041255.4b687882@posting.google. com>...
    > I've been trying to debug a problem with a constantly running
    > application that is
    > experiencing a performance degradation over time. Today I set up a
    > script to
    > run onstat -g ses every 60 seconds and log the results. One of the
    > things that caught my eye is that this session's memory use increases
    > constantly over time.
    > For example,
    >
    > total
    > memory
    > 13:38 1265664
    > 14:38 1977408A
    > 15:38 2646016
    >
    > Will the total memory ever decrease during the lifespan of a session?
    >
    A short followup to this question. After we received the feedback in
    the previous posts we started looking closely at the code for this
    application. We found several cursors that were not freed in the
    code. I think it's important to note that the code, however flawed,
    had been in production for months and ran under the 7.31UC6 engine
    with no problems. When we upgraded to 9.30, the same code would
    gradually run slower and slower until it ground to halt. Restarting
    the app would fix the problem...for a while.

    We had both our programming staff and IBM consulting look at the
    offending program and found we had cursors that were declared with
    hold and were not freed. According to our consultant this is an issue
    with 9.3 but is "fixed" in 9.4 We changed the program to declare the
    cursors without hold, as the hold feature was not needed and freed the
    cursors. After the changes were made, the memory issue was resolved.

    Regards,
    Dave Thacker
    Dave Thacker Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139