Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 15th, 2007, 04:43 AM
discipline discipline is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 8 discipline User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 55 m 56 sec
Reputation Power: 0
Question MAJOR memory leak with bulk inserts..

I have written a Delphi 7 application that imports data from XML into a Firebird 1.5.3 database. The program makes tens of thousands of inserts and there seems to be a MAJOR memory leak in Firebird, because fbserver.exe grow to 200 MB very quickly and then just continues to grow. I am performing a commit every 100 rows or so.. Anyone know a way around this?

All I do is a bunch of inserts in a transaction to various different tables..

Any help or work-around suggestions highly appreciated!

PS. Just for the fun of it I tried with Firebird 2 and the memory leak seems much smaller there since fbserver.exe does not grow as rapidly. I can not use 2.0 though and databases created with 2.0 can't seem to be opened in 1.5.3?

-- Johan

Reply With Quote
  #2  
Old January 15th, 2007, 04:52 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,826 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 1 Day 9 h 59 m 53 sec
Reputation Power: 278
Quote:
Originally Posted by discipline
I have written a Delphi 7 application that imports data from XML into a Firebird 1.5.3 database. The program makes tens of thousands of inserts and there seems to be a MAJOR memory leak in Firebird, because fbserver.exe grow to 200 MB very quickly and then just continues to grow. I am performing a commit every 100 rows or so.. Anyone know a way around this?

All I do is a bunch of inserts in a transaction to various different tables..

Any help or work-around suggestions highly appreciated!
Did you try with more frequent commits? Do you explicitly start a new transaction after commit?
I'd anyway post to the developer mailing list (after having searched it for similar cases) and fill a bug report.
Quote:
PS. Just for the fun of it I tried with Firebird 2 and the memory leak seems much smaller there since fbserver.exe does not grow as rapidly. I can not use 2.0 though and databases created with 2.0 can't seem to be opened in 1.5.3?

-- Johan
See this thread about upgrading from Fb 1.5.x to 2.0

Reply With Quote
  #3  
Old January 15th, 2007, 06:15 AM
discipline discipline is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 8 discipline User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 55 m 56 sec
Reputation Power: 0
Quote:
Originally Posted by pabloj
Did you try with more frequent commits? Do you explicitly start a new transaction after commit?
I'd anyway post to the developer mailing list (after having searched it for similar cases) and fill a bug report.
See this thread about upgrading from Fb 1.5.x to 2.0

I tried commits after every insert. No difference.

I can't use FB2.0 for the import utility I'm writing because the main apps are using FB1.5 still and they can't seem to read databases created in FB2.0. I will upgrade to FB2.0 later this year but I would like to get this working asap.

Reply With Quote
  #4  
Old January 15th, 2007, 07:20 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,826 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 1 Day 9 h 59 m 53 sec
Reputation Power: 278
Quote:
Originally Posted by discipline
... because the main apps are using FB1.5 still and they can't seem to read databases created in FB2.0. ...
Are you using the embedded database?

Reply With Quote
  #5  
Old January 15th, 2007, 08:13 AM
discipline discipline is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 8 discipline User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 55 m 56 sec
Reputation Power: 0
Quote:
Originally Posted by pabloj
Are you using the embedded database?

If I use the embedded database; the exe of the application grows. If I don't; fbserver.exe grows.

Reply With Quote
  #6  
Old January 15th, 2007, 12:01 PM
clivew clivew is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 760 clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 23 h 28 m 9 sec
Reputation Power: 19
Quote:
Originally Posted by discipline
If I use the embedded database; the exe of the application grows. If I don't; fbserver.exe grows.


1. Are you using commit or commitRetaining?

2. Which Delphi components are you using for DB access?

3. Are you able to post the Delphi code including the SQL?

4. What type of Firebird install are you running?

Clive

Reply With Quote
  #7  
Old January 15th, 2007, 04:53 PM
discipline discipline is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 8 discipline User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 55 m 56 sec
Reputation Power: 0
Quote:
Originally Posted by clivew
1. Are you using commit or commitRetaining?

2. Which Delphi components are you using for DB access?

3. Are you able to post the Delphi code including the SQL?

4. What type of Firebird install are you running?

Clive

1. Tried both. Makes no difference.

2. Tried with IBX 7.08, IBX 7.11 and even with the latest IBO Beta. Nothing helps.

3. It's posting to a lot of tables and a lot of XML reading code. Not sure how to post that. If someone is experienced in Firebird and got Delphi7 I could send the code or something.

4. Tried both 1.5.3 SuperServer and Embedded. Same result with both. Firebird 2.0 leaks A LOT less using the same code but 1.5.3 leaks like a maniac.

Reply With Quote
  #8  
Old January 15th, 2007, 05:53 PM
clivew clivew is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 760 clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level)clivew User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 23 h 28 m 9 sec
Reputation Power: 19
Well, I have Delphi 7 and Firebird and am experienced with both;
but I am not anxious to get in that deep right now.

Is there a useful way you can just post (or email me if posting publicly is an issue)
the code for the methods that encapsulate setting the insert parameters
and the inserts and posts themselves?

Is there anything in stored procedures or triggers that could be leaking memory
or generating some unanticipated recursion?

I use IBObjects for access myself.
Not because I think they are better, or would make a difference to your problem.
Just because they are committed to remaining Firebird compatible while IBX is not (to my knowledge).

I have a number of Firebird projects in long term use and have not experienced this problem.
On the other hand, they do not do tens of thousands of inserts at a time.
For projects with that level of activity I have been fortunate enough to be able to specify Oracle.

Clive.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > MAJOR memory leak with bulk inserts..


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway