Unix Technical Forum

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

This is a discussion on Re: Is gradually increasing memory in long running session normal? within the Informix forums, part of the Database Server Software category; --> Hi Roland: In our programs we also FREE the cursor let query = "select ..." prepare query_prep from query ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 07:37 PM
Fernando Ortiz
 
Posts: n/a
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
> 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 07:38 PM
Roland Wintgen
 
Posts: n/a
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
>> 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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:42 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com