Memory deallocation after calling cast function - Mailing list pgsql-hackers

From Soroosh Sardari
Subject Memory deallocation after calling cast function
Date
Msg-id CAFUsPDZQLHKetjY2iG0MZK9R2oK72xcYVpARWoxc49Z6jLUgBQ@mail.gmail.com
Whole thread Raw
Responses Re: Memory deallocation after calling cast function  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi

I have problem with memory deallocation. look at the following queries

1- create table test01(a) as select generate_series(1,100000000)::int8 ;

2- create table test02(a) as select generate_series(1,100000000) ;

In execution of first query, memory usage increase rapidly until the transaction comes to end and deallocate all the memory which allocated with palloc.
I have wondered why all the memory deallocated at the end, so the cast is removed and query executed again. memory usage was not the same. It was grow very slow.

I need help to find the right point to deallocate the memory,
Any idea will be appreciated.

Soroosh Sardari

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: 9.4 release notes
Next
From: Magnus Hagander
Date:
Subject: Re: pg_stat directory and pg_stat_statements