Re: psql leaks memory on query cancellation

2018-04-25 Thread Craig Ringer
On 13 April 2018 at 05:10, Tom Lane wrote: > Therefore, I propose the attached patch, which simply sees to it that > we discard any partial query result at the start of error message > collection not the end. This makes the behavior very much better, > at least on Linux. > >

Re: psql leaks memory on query cancellation

2018-04-23 Thread Komяpa
> > Therefore, I propose the attached patch, which simply sees to it that > we discard any partial query result at the start of error message > collection not the end. This makes the behavior very much better, > at least on Linux. > I have tested the build of Postgres with attached patch and

Re: psql leaks memory on query cancellation

2018-04-12 Thread Teodor Sigaev
I imagine that this indicates that control-C processing allocates some memory it doesn't free, resulting in an "island" up at the end of memory that prevents glibc from releasing all the free memory it's got. Whether that's an actual leak, or just memory we're holding onto in hopes of reusing

Re: psql leaks memory on query cancellation

2018-04-12 Thread Tom Lane
Craig Ringer writes: > On 12 April 2018 at 18:26, Darafei "Komяpa" Praliaskouski > wrote: >> Is it expected behavior (so I can have a look at something server returned >> somehow and it's kept there for me), or a plain leak? > This is totally normal

Re: psql leaks memory on query cancellation

2018-04-12 Thread Komяpa
> > > > Is it expected behavior (so I can have a look at something server > returned > > somehow and it's kept there for me), or a plain leak? > > This is totally normal behaviour for any C program. > Thanks Konstantin and Craig for the help. To mitigate the issue I've changed the allocator on

Re: psql leaks memory on query cancellation

2018-04-12 Thread Craig Ringer
On 12 April 2018 at 18:26, Darafei "Komяpa" Praliaskouski wrote: > Hi, > > psql (PostgreSQL) 10.3 > > Here are the steps to reproduce a leak: > > 1. connect to 10.3 server, perform the query similar to: > > select 'message' || generate_series(1,10); > > 2. monitoring

Re: psql leaks memory on query cancellation

2018-04-12 Thread Konstantin Knizhnik
On 12.04.2018 13:26, Darafei "Komяpa" Praliaskouski wrote: Hi, psql (PostgreSQL) 10.3 Here are the steps to reproduce a leak: 1. connect to 10.3 server, perform the query similar to: select 'message' || generate_series(1,10); 2. monitoring psql memory usage in htop or similar

psql leaks memory on query cancellation

2018-04-12 Thread Komяpa
Hi, psql (PostgreSQL) 10.3 Here are the steps to reproduce a leak: 1. connect to 10.3 server, perform the query similar to: select 'message' || generate_series(1,10); 2. monitoring psql memory usage in htop or similar tool, press ctrl+c at some point where you can clearly distinguish