Paul Leskinen wrote:
>
> I was hoping that someone out there has encountered this problem:
>
> We have an online transaction-processing application that stays resident
> and processes financial transactions using Informix. The problem is that
> Informix Online keeps allocating more and more shared memory for the
> process(es).
... and if your system has no more memory, OnLine goes down ...;-)
> (We did an
> onstat -g ses xxx to obtain that information while the program is running).>
> One more note: When the program terminates, all shared memory allocated by
> Informix is freed. An obvious solution would be for our OLTP to terminate
> and restart once in awhile to avoid this problem--but that's kind of
> unsightly behavior for a "continously" available application.
>
Because your demo application uses only one static SQL-statement I think
it's hard to find the problem. What about several statements like this:
exec sql select .....;
system( "onstat -g ses ##" );
getchar();
exec sql select .....;
system( "onstat -g ses ##" );
getchar();
...
What I know is, that Informix has two different memory management
routines in the OnLine Server. The one which manages the virtual
portion ( 8KB blocks ) and another one for the prepared SQL-statements
and cursors, called ralloc() ( this function used 1096 Byte blocks in
earlier versions ). Once you prepare a statement, the memory will be
allocated inside the virtual portion. From now on this memory can only
be used by the session which allocated the memory, even if the session
frees the prepared statement id. This means, if you prepare a lot of
different statements at the beginning of your application, you can see
the growth of the ralloc() pool with "onstat -g ses ##". If you don't
need the memory any more, and now try to free the prepared statements
or cursors, this memory can't be reused by other sessions. Depending on
the kind of programming this could cause a memory problem inside the
server.
I have made a few tests with stored procedures, too. But I didn't detect
a memory problem with SPL. Now I'm interested in your memory problems
with static SQL-statements. You would do me a favor, if you run the
test with several statements and tell me sth. about your results.
Bye
Stefan
stefan@weideneder.de