Print Thread
Page 1 of 2 1 2
TOracleDataset: Out of memory
#39316 01/20/11 11:30 AM
Joined: Jun 2005
Posts: 37
Norway
A
Arvid Offline OP
Member
OP Offline
Member
A
Joined: Jun 2005
Posts: 37
Norway
I've got the same problem nicofari "Out of Memory with TOracleDataset" - I found no real answer to his questions.

We have a query returning 145000 rows of data.

The problem seems to be that TOracleDataset does not handle data from functions in sql results very well.

I made a test application - when I do not use any functions I get a memory user of 72 Mb - even though the grid displays 145000 rows with the same ammount of columns, and same amount of data.

When I use a function to populate one of the rows the test application suddenly use 747 Mb of memory. Still 145000 rows.

The original sql uses 8 functions for populating the result. So I assume this cause the out of memory. Any idea why? And is there any way of getting around this problem?
I would cosider this a bug...

Another thing I noticed.
If I set "QueryAllRecords" and "CountAllRecords" to false - things work as long as the user does not scroll all the way to the bottom of the grid.
If I set "QueryAllRecords" to false and "CountAllRecords" to true I get the "out of memory" when I run the query. Why is that? Does setting "CountAllRecords" cause "QueryAllRecords" to be set as well?



Re: TOracleDataset: Out of memory
Arvid #39317 01/20/11 12:26 PM
Joined: Jun 2005
Posts: 37
Norway
A
Arvid Offline OP
Member
OP Offline
Member
A
Joined: Jun 2005
Posts: 37
Norway
Example:
select a.jurpersonid, a.Etternamn, a.fornamn, reskontro.f_test (b.maalepktnr) kommunenr
from felles.efjurperson a, kunde.ekkontrakt b
where a.jurpersonid = b.kundenr

When running this sql - returning 15000 rows of data my application will use 84Mb of memory.
If I change the function call "reskontro.f_test(b.maalepktnr)" to "b.maalepktnr" - the same ammount of data will be returned but my application only use 24 Mb of memory.

Re: TOracleDataset: Out of memory
Arvid #39318 01/20/11 01:59 PM
Joined: Aug 1999
Posts: 22,214
Member
Offline
Member
Joined: Aug 1999
Posts: 22,214
For 145.000 rows in a result grid you will need to activate QBE for a user to allow him to find the records he is interested in. Nobody can view 145.000 records. QueryAllRecords must be set to False as well.


Marco Kalter
Allround Automations
Re: TOracleDataset: Out of memory
Marco Kalter #39322 01/20/11 02:07 PM
Joined: Jun 2005
Posts: 37
Norway
A
Arvid Offline OP
Member
OP Offline
Member
A
Joined: Jun 2005
Posts: 37
Norway
The issue is not really the 145.000 rows but the huge memory usage when querying using functions i TOracleDataset - why is that?

Depending om what limitations the customer set they may get 10 rows in the report or 150.000. Do you mean that I will need to check every sql sendt and find number of rows returned then decide if QBE/QueryAllRecords should be active or not? That does not seem like a good solution to me...

Re: TOracleDataset: Out of memory
Marco Kalter #39325 01/21/11 06:15 AM
Joined: Jun 2005
Posts: 37
Norway
A
Arvid Offline OP
Member
OP Offline
Member
A
Joined: Jun 2005
Posts: 37
Norway
We tested the solution you suggested (QBE) - as for just setting QueryAllRecord and CountAllRecords to false, it works fine as long as the customer does not chose to export the data. Something they do since this is a yearly report they have to run...

The amount of that is not at all huge - so this should not cause "out of memory"!

Re: TOracleDataset: Out of memory
Arvid #39327 01/21/11 06:30 AM
Joined: Jun 2005
Posts: 37
Norway
A
Arvid Offline OP
Member
OP Offline
Member
A
Joined: Jun 2005
Posts: 37
Norway
As a test I removed the TDBGrid, so the only thing that happend is that data is fetched into at TOracleDataset and directly exported to excel.
We also manipulated the oracle functions so that they just return a fixed number/string. To rule out any bugs in the functions.

The behavior of the program is the same: "Out of memory".

Our version of DOA: 4.1.1.0

Re: TOracleDataset: Out of memory
Arvid #39329 01/21/11 11:30 AM
Joined: Aug 1999
Posts: 22,214
Member
Offline
Member
Joined: Aug 1999
Posts: 22,214
If you need to export these amounts of data from a TOracleDataSet, you can set the UniDirectional property to True. This way the records will not be buffered in memory. The dataset cannot be connected to a grid in this case.


Marco Kalter
Allround Automations
Re: TOracleDataset: Out of memory
Marco Kalter #39333 01/21/11 12:02 PM
Joined: Jun 2005
Posts: 37
Norway
A
Arvid Offline OP
Member
OP Offline
Member
A
Joined: Jun 2005
Posts: 37
Norway
That is not really an option since we then would need to change how our application work.

Can you confirm the problem/bug with regards to using function results in sql's in TOracleDataset? Have you tested it yet?

I have just tested implementing a component called ODAC (http://www.devart.com/odac/components.html) and populating TDBGrid with data from that control.
When I run the report using TOraQuery from ODAC the result is a memory use of 99 MB - when using TOracleDataset the application chrash with "Out of memory" when memory usage exceeds 1300MB.

Re: TOracleDataset: Out of memory
Arvid #39336 01/22/11 04:08 AM
Joined: Nov 2000
Posts: 31
Carlsbad, CA USA
C
Member
Offline
Member
C
Joined: Nov 2000
Posts: 31
Carlsbad, CA USA
What happens with a TOracleQuery?

Re: TOracleDataset: Out of memory
clivew #39337 01/24/11 07:19 AM
Joined: Jun 2005
Posts: 37
Norway
A
Arvid Offline OP
Member
OP Offline
Member
A
Joined: Jun 2005
Posts: 37
Norway
TOracleQuery has a normal memory usage.

Re: TOracleDataset: Out of memory
Arvid #39339 01/24/11 09:36 AM
Joined: Jun 2005
Posts: 37
Norway
A
Arvid Offline OP
Member
OP Offline
Member
A
Joined: Jun 2005
Posts: 37
Norway
If a function returns VARCHAR2 - the memory consuption of TOracleDataset is too high - for number the memory usage seem to be normal...

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.051s Queries: 15 (0.011s) Memory: 2.5644 MB (Peak: 3.0395 MB) Data Comp: Off Server Time: 2024-05-09 16:40:21 UTC
Valid HTML 5 and Valid CSS