Subject Blob concat consume memory - why?
Author liviuslivius
Hi,
 
why concating blob consume memory and not leave it until transaction end?
 
simple sample
 
SET TERM ^ ;
 
CREATE PROCEDURE TEST_BLOB_CONCAT 
 ( A BLOB SUB_TYPE TEXT, ILE INTEGER ) 
RETURNS 
 ( B BLOB SUB_TYPE TEXT )
AS 
DECLARE VARIABLE VAR_I INTEGER; 
BEGIN
  VAR_I = 0;
  B = 'ABC';
  WHILE (VAR_I<ILE) DO
    BEGIN
      B = B || A;
      VAR_I = VAR_I + 1;
    END
  SUSPEND;
END^
 
SET TERM ; ^
 
/*----------------------------------------------------*/
 
SELECT * FROM TEST_BLOB_CONCAT('', 5000) 
result 'ABC'
 
consume memory 
________used: 12208
_________max: 38112
_____allocated: 65536
_allocatedmax:  65536
 
/*----------------------------------------------------*/
 
SELECT * FROM TEST_BLOB_CONCAT('', 500000) 
result 'ABC'
 
consume memory 
________used: 12208
_________max: 2338208
_____allocated: 2359296
_allocatedmax:  2359296
 
/*----------------------------------------------------*/
 
SELECT * FROM TEST_BLOB_CONCAT('', 50000000) 
result 'ABC'
 
consume memory all memory from operating system!
 
 
It looks like some temp buffers are created and not freed until transaction end
Is this bug reported or i should report it to the tracker?
 
regards,
Karol Bieniaszewski