Re: Is gradually increasing memory in long running session normal?
Posted in 2003
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
>> www.evg.de rw@evg.de
>>
>>
>>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
www.evg.de rw@evg.de