Linux server connection process consumes all memory - Mailing list pgsql-novice

From Ioannis Anagnostopoulos
Subject Linux server connection process consumes all memory
Date
Msg-id B56C2BFC6806BE4A9C86ADDDD269933A6E8A09@appserver.anatec.local
Whole thread Raw
Responses Re: Linux server connection process consumes all memory
Re: Linux server connection process consumes all memory
List pgsql-novice

Hi all,

This is my first post here and as I wanted to play it safe my first option was the novice list. My problem is as follows:

I have a simple select command that I need for some reason to execute it around 22million times. In fact it is a prepared command from a .net environment. I have used both ado.net postgres options (the freeware NPGSQL and the commercial from Devart) and the behaviour is the same. What happens is that once I establish the connection with the corresponding connection object, a new process is created on the server as expected. When I start iterating executing the select command as time goes by the memory footprint of the process grows bigger and bigger. Sooner or later the server either collapses or becomes unworkable as the physical memory gets exhausted and the swap is heavily used. This is just a simple select, with a data reader that I make sure to close after each iteration. I find no reason why the connection process on the server gets so out of control. Is it caching data? If yes I don't want to. Do I need to close the connection every so often to free up the memory?

Any help will be much appreciated
Kind Regards
Yiannis

pgsql-novice by date:

Previous
From: Henry Drexler
Date:
Subject: Re: stumped on a with recursive example
Next
From: Alan Hodgson
Date:
Subject: Re: Linux server connection process consumes all memory