Subject Re: [firebird-support] Select with blobs use a lot of memory
Author Gustavo
Thank you for your answer.

I didn´t found it on the tracker. Can you please give me the link to it?


----- Original Message -----
From: Alexandre Benson Smith
To: firebird-support@yahoogroups.com
Sent: Sunday, April 03, 2011 4:31 PM
Subject: Re: [firebird-support] Select with blobs use a lot of memory



Hi !

Em 2/4/2011 22:20, Gustavo escreveu:
> Hello:
>
> I have an application in Delphi installed in a network with the following data:
>
> Server:
> Athlon - 1.29GHz - 1GB RAM
> Windows Server 2003
> Firebird 2.1.3.18185 SuperServer
>
> Clients (10):
> Windows XP
>
> Databases: One of 1.6GB and two smaller than 10MB
>
> They use the application since many years ago without problems. But since the last week they have problems when they connect to some databases or when they make some querys. When they have these problems, I can see that the process fbserver.exe is consuming a lot of memory.
>
> I found in firebird.log (in the server) messages like the following:
>
> Allocated 1729 page buffers of 2048 requested
>
> unable to allocate memory from operating system
>
> Investigating in internet and in this forum, I found this may be related with large querys using blob fields. I am almost sure this is the problem because a few days ago they began to use an option which makes a query like the following:
>
> SELECT TIPCLASNRO
> ,FECHA
> ,SUBSTRING(COALESCE(NOTASCOM,'') FROM 1 FOR 100) AS NOTASC
> FROM VPRESUP
>
> The field NOTASCOM is a blob field and table VPRESUP have more than 20000 records.
>
> They never need the whole field. They always use SUBSTRING. So I thougt to do the following:
>
> SELECT TIPCLASNRO
> ,FECHA
> ,SUBSTRING(COALESCE(CAST(NOTASCOM AS CHAR(32000)),'') FROM 1 FOR 100) AS NOTASC
> FROM VPRESUP
>
> This works good because I saw in task manager that the first query uses a lot of memory and the second one practically does not use memory.
>
> But (there is always a but!), this is perfect only if I am sure there is no register with more than 32000 bytes in NOTASCOM. If this is not true, Fireberd returns an error message about string truncation and this does not work.
>
> Does anyone have any idea to suggest?
>
> Thanks in advance

I've faced some similar problem recently...

I use a query like:

select list(FieldA), FieldB from TableA group by Field B

It uses a LOT of memory that is freed uppon transaction finish If my
memory serves me right...

It's a known issue and IIRC corrected on 2.1.4, I found it on the tracker.

see you !




__________ Información de NOD32, revisión 6011 (20110403) __________

Este mensaje ha sido analizado con NOD32 antivirus system
http://www.nod32.com


[Non-text portions of this message have been removed]