Hello,
I use ZEOSLib 7.2.6 stable in Delphi 2010 to create a report (FastReports Release 6) with about 1.000 ID-cards with a photography on the card. Database is Firebird 2.5. The report selects about 1.000 records each with a picture in a blob filed. The picture-size is about 250kbytes as .jpg-file, so the report / datasource will use 250MBytes for the pictures.
During report-creation there is an "out of memory" exception. I sent a small example-project to fast-report and they told me that the error occures in the datasource and not in the report-component. It crashes after loading abut 500 ID-cards.
The computer has 16GByte of memory and Delphi2010-applications (as 32bit-applications) should be able to handle 4GBytes.
Are there any special settings for ZConnection or ZQurey to handle queries with many records and contained large blobs?
I tried the following without any change in number of successfully loaded records:
- ZQuery-Options doCachedLobs
- ZQuery fetchRow with values of 10, 100, 500
The sql is like this (simlified here but there are only some more text-fields in the original query):
select lastname, picture from persons;
A Delphi TDatasource-component is linked to the TZQuery and the report uses this TDatasource to get the records from the database.
Do you need more informations to give me a hint for solving the problem?
Many thanks,
Siegbert
Out of memory with large count of records with BLOBs
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: Out of memory with large count of records with BLOBs
Hello Sigbert,
I may be wrong but with Firebird BLOBs should not be cached, when setting doCacedLobs to false. In this case, BLOBs should always be fetched from the database if you need them. There couold be some inprovements for this use case in the current SVN version of Zeos 7.2.
If this doesn't work out, you could try to see what happens if you do the job in a master - detail kind of way: Have e separate Query for the BLOB data and fetch the data for the current record in the AfterScroll event of TZQuery:
This should free the memory and only load the BLOBs you need.
Best regards,
Jan
I may be wrong but with Firebird BLOBs should not be cached, when setting doCacedLobs to false. In this case, BLOBs should always be fetched from the database if you need them. There couold be some inprovements for this use case in the current SVN version of Zeos 7.2.
If this doesn't work out, you could try to see what happens if you do the job in a master - detail kind of way: Have e separate Query for the BLOB data and fetch the data for the current record in the AfterScroll event of TZQuery:
Code: Select all
procedure MasterQ.AfterScroll(DataSet: TDataSet);
begin
BlobQ.Close;
BlobQ.ParamByName('PersonID').Value := DataSet.FieldByName('PersonID').Value;
BlobQ.Open;
end;
Best regards,
Jan
Re: Out of memory with large count of records with BLOBs
What happens if you just fetch all records in dataset without FR?
Do memory counters show correct values when you fetch 100, 200, 500 records without FR?
What memory counters show when you create report with maximal count of records that won't produce an error?
Do memory counters show correct values when you fetch 100, 200, 500 records without FR?
What memory counters show when you create report with maximal count of records that won't produce an error?
Re: Out of memory with large count of records with BLOBs
I am using Zeos to fetch 10k+ records with XMLs stored as BLOBs, with often being 14MB+ each without memory issues. I'm compiling 64bit apps, though.
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: Out of memory with large count of records with BLOBs
@aehimself,
you are using 7.3(halfed memory for all column except lob's. They are shared since i know Zeos), sigbert is using the last "stable" release of 7.2.
Sigbert, what do you think about an upgrade to 7.3 and report the findings?
you are using 7.3(halfed memory for all column except lob's. They are shared since i know Zeos), sigbert is using the last "stable" release of 7.2.
Sigbert, what do you think about an upgrade to 7.3 and report the findings?
Best regards, Michael
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/
You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/