Subject | Re: Stored Procedures Memory Usage |
---|---|
Author | jssahdra |
Post date | 2004-10-19T10:22:58Z |
--- In firebird-support@yahoogroups.com, "Alan McDonald" <alan@m...>
wrote:
called frequently. As far as I know, this the hard commit. Tell me if
there is anything wrong in it.
EXEC SQL
SET DATABASE DB='/opt/firebird/data/ssg.gdb';
connect_db(&dbconn)
DB=dbconn.conn;
sigsetjmp(env,1);
EXEC SQL
SET TRANSACTION USING DB;
EXEC SQL
UPDATE session SET bytesin=:ses->bytesin, bytesout=:ses-
state='A';
if (db_error
(SQLCODE,&gds__trans,isc_status,"accountupdate.execute",env,&retry))
goto return_error;
EXEC SQL
COMMIT;
pr_error
(SQLCODE,&gds__trans,isc_status,"accountupdate.end");
disconnect_db(&dbconn);
return retval;
wrote:
> > Guys I am trying desparately to get some feedback from thein
> > development team of firebird. Somehow Yahoogroups was not opening
> > India for some days. I had no other option but to post my messageat
> > all places where possible. I have posted this in the firebird Bugrisk some
> > List also, but nobody has responded till now.
> >
> > This is an extension to my previus post "Firebird 1.51.
> > sucking all memory" in firebird-support list on yahoogroups.
> >
> > I am using stored procedures extensibly in my
> > application. There is a part
> > in my application (written in C using EMBEDDED SQL)
> > which executes on an
> > average 250 update/insert queries. Earlier all these
> > updates and inserts
> > were done through Stored Procedures. I was monitoring
> > the memory usage using
> > 'top' command. Memory usage used to increase by 3MB
> > every 5 minutes, so in a
> > fiew hours it used to reach 300MB and then crashing all
> > my applications.
> >
>
>
> Seems that you have only recently started using Firebird so I'll
> dumb questions.realised
> Are you hard commiting these updates/inserts at regular intervals.
> When other people have asked this sort of question they have not
> that hard committing is the best way to keep this sort of memoryuseage
> down. Soft commits maintain the transaction context so it ends upasking a
> lot of the server to do this.You are right, I am new to firebird. Here is the part of code which
> Alan
called frequently. As far as I know, this the hard commit. Tell me if
there is anything wrong in it.
EXEC SQL
SET DATABASE DB='/opt/firebird/data/ssg.gdb';
connect_db(&dbconn)
DB=dbconn.conn;
sigsetjmp(env,1);
EXEC SQL
SET TRANSACTION USING DB;
EXEC SQL
UPDATE session SET bytesin=:ses->bytesin, bytesout=:ses-
>bytesout, lastupd='NOW', trfratein=:ratein,trfrateout=:rateoutWHERE sesno=:ses->session_id AND
state='A';
if (db_error
(SQLCODE,&gds__trans,isc_status,"accountupdate.execute",env,&retry))
goto return_error;
EXEC SQL
COMMIT;
pr_error
(SQLCODE,&gds__trans,isc_status,"accountupdate.end");
disconnect_db(&dbconn);
return retval;