TOracleQuery memory problem

andreas

Member
I have a big problem:
In our application I have a thread which makes a lot (and I mean a lot!) of selects. For each select statement a new TOracleQuery object is created then iterated until eof and then deleted. This procedure may occour some hunderts times. The same TOracleSession object is used all the time. It seems to me, that memory allocated by the query-object isn't freed in its destructor. I am using Borland C++ Builder 5 and I am creating a TOracleQuery-Object with new, and destroying it with delete. If I watch my application with the NT-Systemmonitor I see that every query-object (after Execute() ), increases drastically the virtualsize but it is not reduced
after calling the destructor. The displayed virtualsize value goes up to 2 GB (!) and then I get a out of memory error. :-( What is wrong? I there a memoryleak in the TOracleQuery or am I doing something completely wrong? I am not a windows expert - so I don't know the internals about memory mangement on this system - maybe that it has something to do with the thread the queries are running in?

--------------------------------------
m e c o m Andreas Wagner
Software Development
Mittelweg 143
20148 Hamburg wagner@mecom.de
Germany http://www.mecom.de
--------------------------------------
 
There is no known memory leak in the TOracleQuery component. Note that early versions of Net8 had some memory leaks, so maybe you are running into that.

What Net8 version are you using? Does it help when you set TOracleSession.Preferences.UseOCI7 to True? This would circumvent the Net8 memory leak.

------------------
Marco Kalter
Allround Automations
 
> Does it help when you set TOracleSession.Preferences.UseOCI7 to True?

No, this makes no difference. :-(

But meanwhile I think my problem is another:
Is it possible that an application may run out of virtual address space? We make a lot of querys and create and delete many (mall objects between the querys. Some of those objects are stored for later use. So memory-fragmentation may grow. The used memory is about 60MB (taken from Taskmanger) when the "out of memory error" occours. At this time the virtualsize (of my application as reported by the Systemmonitor) has grown to 2 GB!
It seems to me, that memory-fragmentation and a ineffecient memorymangment of bcb 5 could be the reason. But I am wondering that nobody else had this problem before me...
Do you know a good third party replacement for bcb5 runtime memory manager routines?

--------------------------------------
m e c o m Andreas Wagner
Software Development
Mittelweg 143
20148 Hamburg wagner@mecom.de
Germany http://www.mecom.de
--------------------------------------
 
I would first verify if this is not an application error. Perhaps you forget to free an object instance somewhere? Do you have a memory leak analysis tool like Memory Sleuth available?

------------------
Marco Kalter
Allround Automations
 
Back
Top