Re: Session memory grows a lot
Posted in 1997
We have also a memory 'problem' on solaris Online 7.23.UC1 with the
same constellation ( a lot stored procedures, temp tables).
I made some tests and came to following conclusion:
Whenever a stored procedure is executed the first time the memory
grows.
Just execute onstat -g opn and you will probably see a lot of open
tables for just the tables used in the stored procedure.
If you re-execute the same procedure the memory will stay the same
size.
The memory is free when the session closes.
I could simulate an identical memory behaviour by writing an
ESQL/C-Programm, that opens cursors, closes them but doesn't drop them
but REUSES them.
So my theory:
Since Online caches SPs they also keep the cursors so they don't need
to be recreated.
The open tables ( seen by onstat -g tab) should be the ones used in
cached procedures ( seen by onstat -g prc).
So it turned out for me not a memory leak but a tradeoff memory versus
speed.
I think I even verified that the memory is freed, when the procedure
is thrown out of the cache.
Maybe this will help you,
Greetings
Harald Ums
ivan.lopes@rio.rsl.com.br (Ivan Lopes) wrote:
>Hi,
>
>I am having serious problems because the session memory grows too much.
>Some sessions at the end of the day have 20 Mb!!!!
>
>We use a lot stored procedures, cursors and temp tables, but I don't think this could cause
>this HUGE memory allocation.( Informix 7.23 on DEC Unix 4.0)
>
>
>TIA,
>
>Ivan Lopes
>DB Solution - Rio de Janeiro - Brazil
>
>--
>Part of onstat -g ses (note that some sessions have 8Mb of total memory).
>
>
>INFORMIX-OnLine Version 7.23.FC1X3 -- On-Line -- Up 2 days 12:48:47 -- 165216 Kb
>ytes
>
>session #RSAM total used
>id user tty pid hostname threads memory memory
>26662 informix - 0 - 0 8192 5912
>20588 38830 - -1 ac100846 1 4833280 3840032
>15574 37508 - -1 ac100845 1 98304 44936
>12830 45543 - -1 ac100854 1 835584 125496
>10169 37508 - -1 ac100845 1 8069120 3944344
>7119 26662 - -1 ac100844 1 835584 103952
>3028 48810 - -1 ac100847 1 98304 44840
>2425 37737 - -1 ac100848 1 2621440 2524168
>61758 48810 - -1 ac100847 1 8241152 4259736
>59974 33740 - -1 ac1008a2 1 5087232 3586400
>55704 35980 - -1 ac10084a 1 180224 131112
>;
>;
>;
>
>
Harald Ums Tel : +49 (89) 9507-5140
seven.sys Information Services GmbH Fax : +49 (89) 9507-5191
Gutenbergstra'e 3 D-80767 Unterf'hring e-mail: Harald.Ums@sevensys.de