|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Stored Procedure Memory Usage
Guys I am trying desparately to get some feedback from the development team of firebird. Somehow Yahoogroups is not opening in India for some days. I have no other option but to post my message at all places where possible. I have posted this in the firebird Bug 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. Now I have removed all insert and update statements from the stored procedures and put them into my application. AND there was amazing difference in memory increase. In 37 Hours, it reached only 57MB. I am still using stored procedures to query the database but not any updates/inserts. This application is a server based application where it should be running for months without any manual intervention. I can not afford to have even 57MB increase. Major portion of the application is still using stored procedures (doing inserts/updates), but it is very less used. So can somebody from the development team comment on my following queries. 1. Is it a known problem ? If not then should I post it to the bug list ? 2. Are there any planned future releases, where this problem is solved ? Guys I will appriciate, if you can answere this question. Becuase I chose firebird only because of it having stored procedures/views/speed etc over MySQL. I can not afford to have these problems in the database. I would rather spend more time porting my application to some other database, than continuing with these problems. My exeperience with MySQL and Postgres is very good. I never faced such problems with them. I was expecting the same stability from the firebird also. 3. Are there any short term workaround for this problem ? If required, i can post my test db and related files. Regards: Joga Singh |
|
#2
|
||||
|
||||
|
could you give the database script to test it ?
|
|
#3
|
|||||
|
|||||
|
Quote:
No, it is not known problem. And you should NOT post it to bug-list, unless you have created reproducible test case. Quote:
You mean releases of your application ? Quote:
Yes, fix your application. Do you use any UDFs ? Do you properly close or unprepare all statements ? Do you update the same data in single stored procedure or single transaction ? |
|
#4
|
|||
|
|||
|
Quote:
So, does the memory usage still increase continuously (just slower), or does it stop at some level ? |
|
#5
|
|||
|
|||
|
Quote:
Can somebody do this test? There seems to be some memory leak in the udf 'addDay'(fbudf comes with firebird). If I call the Stored Procedure given below in a loop, memory usage of firebird (using top command in linux) crosses 100MB in a few minutes. When I comment the statement calling 'addDay', there is no memory increase. JS Code:
------------------------------------- SET TERM !!; CREATE OR ALTER PROCEDURE testget_maxdate RETURNS (retval int) AS declare date_in timestamp; declare ret_in timestamp; begin date_in=current_timestamp; ret_in=addday(date_in,1); -- ret_in=addday(cast(date_in as date),1); -- ret_in=addmillisecond(addday(cast(date_in as date),1),-1); retval=1; SUSPEND; end !! SET TERM ; !! |
|
#6
|
|||
|
|||
|
I just tried it on 64-bit 1.5.2.4634.
Yes, it indeed eats memory very quickly. I'm gonna look at it right now. But it would be better if you posted such a nice testcase to firebird-devel mailing list. |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > Stored Procedure Memory Usage |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|