James Im wrote:
Hi, I'm using Postgresql 8.1 on windows2000 and I have a hard time understanding how to limit the memory of the sessions to 1 MB.
Well, you don't explicitly, but see below.
What I have right now is that each connection (opened with jdbc) takes about 3MB (some take a little more, some a little less). I think that this is a waste of memory (am-I wrong?).
Depends what you mean by "waste". If you never use those connections, then yes. Otherwise, each connection does need a little space to work in you know.
I've read the doc (http://www.postgresql.org/docs/8.1/static/runtime-config-resource.html) for work_mem and temp_buffers and they have this value: work_mem = 1024 temp_buffers = 100 What am I missing to limit the memory taken by session to 1MB?
You can't. In particular, work_mem is memory *per sort* so can be several times that. If you're trying to get PG to run in 64MB or something like that, I think you're going to be disappointed. In particular, large result sets will tend to need more than 1MB at either the server or client end of the connection.
Is there a particular problem you're trying to solve?
In addition I'd like to understand better temp_buffers. I never create temporary tables but I wonder if postgresql does it behind the scene when I do some big selects.
Various operations will spill to disk in a similar manner to a temporary table, but they're not tables per-se.
-- Richard Huxton Archonet Ltd