Print Thread
Page 1 of 2 1 2
"Out of Memory" after many SELECTS
#7688 08/09/05 08:25 PM
Joined: May 2005
Posts: 22
B
Member
OP Offline
Member
B
Joined: May 2005
Posts: 22
In our application I get a "Out of memory"-Exception in the TRecordDataList.AllocateBlock-Methode when calling GetMem.

This problems doesn't appear when replacing the default-memorymanager with FastMM (http://sourceforge.net/projects/fastmm/).

The problem is also invisible when doing the same work with one of our other supported databases (Our application support 4 DBM's).

So it seems that the default-Delphi-Memory-Manager gets a fragmentation-problem with DOA. The memory-consumption when checking it in Windows-Taskmanager show that the application have only 350 MB of Memory allocated.

Are there any known issues for this problem?

Re: "Out of Memory" after many SELECTS
#7689 08/09/05 09:58 PM
Joined: Aug 1999
Posts: 22,216
Member
Offline
Member
Joined: Aug 1999
Posts: 22,216
How large are these result sets? Note that for some dataset functionality it may be appropriate to set UniDirectional to True to prevent memory overhead.


Marco Kalter
Allround Automations
Re: "Out of Memory" after many SELECTS
#7690 08/10/05 11:48 AM
Joined: May 2005
Posts: 22
B
Member
OP Offline
Member
B
Joined: May 2005
Posts: 22
Normaly only 1 Record. In some cases up to a few hunderts.

Re: "Out of Memory" after many SELECTS
#7691 08/23/05 06:41 PM
Joined: Jun 2002
Posts: 17
Dublin, Ireland
D
Member
Offline
Member
D
Joined: Jun 2002
Posts: 17
Dublin, Ireland
Is there any update on this issue ?
I have a similar problem in a three-tier app. In my case it occurs on opening client datasets. The problem is not isolated to any particular one and the datasets in question can have been previously opened many many times. Also, the problem does not occur with a BDE server layer, only with DOA components.

Re: "Out of Memory" after many SELECTS
#7692 08/23/05 07:14 PM
Joined: Aug 1999
Posts: 22,216
Member
Offline
Member
Joined: Aug 1999
Posts: 22,216
Beyond the UniDirectional tip, I have no other tips. You can use this in a server application as well if TDataSetProvider.ResolveToDataSet = False.


Marco Kalter
Allround Automations
Re: "Out of Memory" after many SELECTS
#7693 08/25/05 03:59 AM
Joined: Jun 2002
Posts: 17
Dublin, Ireland
D
Member
Offline
Member
D
Joined: Jun 2002
Posts: 17
Dublin, Ireland
Yeah - I tried the Unidirectional but it didn't do any good. I wrote a multi-threaded stress test program to constantly open and close a set of datasets - which is TOracleDataSet and TOracleProvider pairs in a multi-threaded server application. This essentially mimics multiple client PCs running against the server layer. Eventually I managed to get Delphi to break while running the server program through the IDE. It failed with an exception somewhere within the TOracleDataSet.InternalInitFieldDefs. I haven't managed to tie it down further than that, as it takes hours, or even days to get it even this far. Does this lead you to think in any specific direction ? This is Delphi 4 by the way, and DOA 4.0.6. This is a production environment, so its a particularly serious problem for my business. Any help or suggestions your have would be gratefully received. Thanks.

Re: "Out of Memory" after many SELECTS
#7694 08/25/05 04:17 AM
Joined: Jun 2002
Posts: 17
Dublin, Ireland
D
Member
Offline
Member
D
Joined: Jun 2002
Posts: 17
Dublin, Ireland
Actually, as an addition to the last post, an "out of memory" also occurs in the GetMem call of the OracleData unit TRecordDataList.AllocateBlock.

Re: "Out of Memory" after many SELECTS
#7695 08/25/05 07:29 PM
Joined: Aug 1999
Posts: 22,216
Member
Offline
Member
Joined: Aug 1999
Posts: 22,216
[quote]Yeah - I tried the Unidirectional but it didn't do any good.[/quote]Why not?


Marco Kalter
Allround Automations
Re: "Out of Memory" after many SELECTS
#7696 08/25/05 09:50 PM
Joined: Jun 2002
Posts: 17
Dublin, Ireland
D
Member
Offline
Member
D
Joined: Jun 2002
Posts: 17
Dublin, Ireland
In other words, I get the errors with or without it. So setting Unidirectional had no effect.

Re: "Out of Memory" after many SELECTS
#7697 08/26/05 06:40 PM
Joined: Aug 1999
Posts: 22,216
Member
Offline
Member
Joined: Aug 1999
Posts: 22,216
That's odd, because with UniDirectional there is no memory overhead. Perhaps there are some other memory consuming functions occurring?


Marco Kalter
Allround Automations
Re: "Out of Memory" after many SELECTS
#7698 09/01/05 09:02 PM
Joined: Jun 2002
Posts: 17
Dublin, Ireland
D
Member
Offline
Member
D
Joined: Jun 2002
Posts: 17
Dublin, Ireland
Hi Marco. Since my last post I have coded a stress test project to work in a two tier mode, simply opening and closing TOracleDataSet's directly without any three-tier stuff involved, and that works fine. The problem seems to have all the hallmarks of a memory leak type problem, buried somewhere in the provider.pas, or in some unit that it uses. I have tried to use codeSlueth to check for memory problem, but its not my forte and I didn't get very far. It doesn't seem to be in anything my code is doing, because in the stress test project it doesn't really run any code, its just opening and closing client datasets in a pile of threads. There's no processing of the results. If I was able to get a scaled down version of very simple server and client apps, would you be able to have a look at it for me and see if you can spot anything ?
Thanks.

Re: "Out of Memory" after many SELECTS
#7699 09/02/05 07:14 PM
Joined: Aug 1999
Posts: 22,216
Member
Offline
Member
Joined: Aug 1999
Posts: 22,216
I can check it out with TurboPower Sleuth. Did you use that too?


Marco Kalter
Allround Automations
Re: "Out of Memory" after many SELECTS
#7700 09/03/05 08:10 PM
Joined: Jun 2002
Posts: 17
Dublin, Ireland
D
Member
Offline
Member
D
Joined: Jun 2002
Posts: 17
Dublin, Ireland
I am not familiar with that tool. I went looking for it, but I don't know where to get it any more. It looks like its been defunct a while. The turbopower.com website doesn't respond either. Anyway, I have now built a scaled down very of two apps, one for the server layer and another for the client. I have removed any dependencies to any of my own or third party components, apart from DOA obviously, and the query that it runs is off one of the Oracle system tables, so I have removed any dependency on my own database and schema too. How can I send you these ?

Re: "Out of Memory" after many SELECTS
#7701 09/05/05 07:39 PM
Joined: Aug 1999
Posts: 22,216
Member
Offline
Member
Joined: Aug 1999
Posts: 22,216


Marco Kalter
Allround Automations
Re: "Out of Memory" after many SELECTS
#7702 09/22/05 03:29 AM
Joined: Jun 2002
Posts: 17
Dublin, Ireland
D
Member
Offline
Member
D
Joined: Jun 2002
Posts: 17
Dublin, Ireland
Hiya Marco. Any news ?

Re: "Out of Memory" after many SELECTS
#7703 09/22/05 07:51 PM
Joined: Aug 1999
Posts: 22,216
Member
Offline
Member
Joined: Aug 1999
Posts: 22,216
Sorry for the delay, I have not yet been able to check it out. I will get to this shortly though, and will get back to you.


Marco Kalter
Allround Automations
Re: "Out of Memory" after many SELECTS
#7704 09/23/05 01:11 AM
Joined: Jun 2002
Posts: 17
Dublin, Ireland
D
Member
Offline
Member
D
Joined: Jun 2002
Posts: 17
Dublin, Ireland
Just for further info, I have now written the same test project that I gave you in Delphi 5, and it does NOT seem to experience the same problems. This would seem to imply that its an actual Delphi 4 bug that was somehow fixed in 5. Now sure if that helps you any. It doesn't help me too much because of the size of my applications. I can't quickly convert and release a D5 version. Ta.

Page 1 of 2 1 2

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.031s Queries: 13 (0.007s) Memory: 2.5944 MB (Peak: 3.0420 MB) Data Comp: Off Server Time: 2024-05-12 07:30:44 UTC
Valid HTML 5 and Valid CSS