Fwd: [GENERAL] High consumns memory
2009/7/1 Albe Laurenz laurenz.a...@wien.gv.at Anderson Valadares wrote: [this is on Windows, DB is accessed with ODBC driver 8.4.3] Thanks for the answer ... But honestly I think that was a misunderstood. The memory increase issue is showed in the DATA column. Look how day by day it increases exponencially. In a few days PostGres goes out of memory, close the connections and enter in a recovery mode. I really don’t know what is causing it. Date 29/06/2009 PID USER PR NI VIRT SWAP RES SHR DATA CODE S %CPU %MEM TIME+ COMMAND 9943 postgres 15 0 860m 41m 819m 811m 9604 3540 D 88.3 20.4 0:08.33 postgres: dbtest test 10.255.100.73(4796) SELECT Date 29/06/2009 PID USER PR NI VIRT SWAP RES SHR DATA CODE S %CPU %MEM TIME+ COMMAND 9943 postgres 15 0 994m 33m 960m 818m 143m 3540 S 29.5 23.9 48:19.96 postgres: dbtest test 10.255.100.73(4796) idle Date 29/06/2009 PID USER PR NI VIRT RES SHR CODE DATA S %CPU %MEM TIME+ COMMAND 9943 postgres 16 0 1366m 1.3g 818m 3540 515m S 31.2 33.2 192:20.61 postgres: dbtest test 10.255.100.73(4796) SELECT Date 30/06/2009 PID USER PR NI VIRT SWAP RES SHR DATA CODE S %CPU %MEM TIME+ COMMAND 9943 postgres 17 0 1724m 30m 1.7g 821m 873m 3540 R 27.2 42.2 325:54.83 postgres: citgis citgis 10.255.100.73(4796) SELECT Now that is weird. How can the same backend process suddenly be connected to database citgis as user citgis? Do you have an explanation? What is your work_mem setting? This influences the amount of private memory a backend will allocate. Can you say more that executes a PL/pgSQL function in a loop about the workload? Are there long transactions? Which version of PostgreSQL is this? Yours, Laurenz Albe Answering ... 1. PostGre SQL 8.3.6 2. Work_mem – 5MB 3. About the connection citgis citgis ... it was my mistake. Is the same database and the same user, I was renaming to dbtest teste only for security ... 4. About the “function loop”. I have a windows service that execute a select (limit 200) each 500ms and after that it calls a PostGre procedure (developed for us). for each row returned in my select. Thanks again -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Fwd: [GENERAL] High consumns memory
2009/7/1 Merlin Moncure mmonc...@gmail.com: On Mon, Jun 29, 2009 at 8:14 PM, Anderson Valadaresanderva...@gmail.com wrote: Hi all I have a software developed in Delphi as a Windows Service, but, i don't know why, it consumns an unexpected large system memory (515m). The service access PostgresSQL by ODBC driver (psqlodbc_08_03_0400) and it consist simply of a loop calling a procedure PL/PGSQL. How to discover what is causing or why this high memory usage ? What objects are being used on this session ? you are definitely leaking. resident memory size (RES) of 1gb+ is not a normal situation. I bet that you have a transaction that is not being completed. First thing to check is: select * from pg_stat_activity; and see if your backend (by pid) is in IDLE, running a query, or 'IDLE in transaction.' Also, try not to top-post(paste your response _below_ mine), and send plain text email where possible. merlin Well, Thank for your answer. I double check what you ask me ... About the leaking memory, i think as you that i’m having it ... but i can find where is it or in which part of the procedure is responsable. The pg_start_activity does not return any uncompleted transation. I work with subtransations inside the main transaction. Any ideia ? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] High consumns memory
Anderson Valadares wrote: [this is on Windows, DB is accessed with ODBC driver 8.4.3] Thanks for the answer ... But honestly I think that was a misunderstood. The memory increase issue is showed in the DATA column. Look how day by day it increases exponencially. In a few days PostGres goes out of memory, close the connections and enter in a recovery mode. I really don’t know what is causing it. Date 29/06/2009 PID USER PR NI VIRT SWAP RES SHR DATA CODE S %CPU %MEMTIME+ COMMAND 9943 postgres 15 0 860m 41m 819m 811m 9604 3540 D 88.3 20.4 0:08.33 postgres: dbtest test 10.255.100.73(4796) SELECT Date 29/06/2009 PID USER PR NI VIRT SWAP RES SHR DATA CODE S %CPU %MEMTIME+ COMMAND 9943 postgres 15 0 994m 33m 960m 818m 143m 3540 S 29.5 23.9 48:19.96 postgres: dbtest test 10.255.100.73(4796) idle Date 29/06/2009 PID USER PR NI VIRT RES SHR CODE DATA S %CPU %MEMTIME+ COMMAND 9943 postgres 16 0 1366m 1.3g 818m 3540 515m S 31.2 33.2 192:20.61 postgres: dbtest test 10.255.100.73(4796) SELECT Date 30/06/2009 PID USER PR NI VIRT SWAP RES SHR DATA CODE S %CPU %MEMTIME+ COMMAND 9943 postgres 17 0 1724m 30m 1.7g 821m 873m 3540 R 27.2 42.2 325:54.83 postgres: citgis citgis 10.255.100.73(4796) SELECT Now that is weird. How can the same backend process suddenly be connected to database citgis as user citgis? Do you have an explanation? What is your work_mem setting? This influences the amount of private memory a backend will allocate. Can you say more that executes a PL/pgSQL function in a loop about the workload? Are there long transactions? Which version of PostgreSQL is this? Yours, Laurenz Albe -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] High consumns memory
On Mon, Jun 29, 2009 at 8:14 PM, Anderson Valadaresanderva...@gmail.com wrote: Hi all I have a software developed in Delphi as a Windows Service, but, i don't know why, it consumns an unexpected large system memory (515m). The service access PostgresSQL by ODBC driver (psqlodbc_08_03_0400) and it consist simply of a loop calling a procedure PL/PGSQL. How to discover what is causing or why this high memory usage ? What objects are being used on this session ? you are definitely leaking. resident memory size (RES) of 1gb+ is not a normal situation. I bet that you have a transaction that is not being completed. First thing to check is: select * from pg_stat_activity; and see if your backend (by pid) is in IDLE, running a query, or 'IDLE in transaction.' Also, try not to top-post(paste your response _below_ mine), and send plain text email where possible. merlin -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] High consumns memory
Hi, Thanks for the answer ... But honestly I think that was a misunderstood. The memory increase issue is showed in the DATA column. Look how day by day it increases exponencially. In a few days PostGres goes out of memory, close the connections and enter in a recovery mode. I really don’t know what is causing it. Date 29/06/2009 top - 07:58:49 up 21 days, 7:47, 1 user, load average: 0.73, 0.74, 0.71 Tasks: 131 total, 1 running, 129 sleeping, 0 stopped, 1 zombie Cpu(s): 13.2% us, 1.3% sy, 0.0% ni, 83.1% id, 1.9% wa, 0.2% hi, 0.2% si Mem: 4107392k total, 3764272k used, 343120k free,24760k buffers Swap: 2031608k total, 592k used, 2031016k free, 354k cached PID USER PR NI VIRT SWAP RES SHR DATA CODE S %CPU %MEMTIME+ COMMAND 9943 postgres 15 0 860m 41m 819m 811m 9604 3540 D 88.3 20.4 0:08.33 postgres: dbtest test 10.255.100.73(4796) SELECT 32731 postgres 16 0 854m 741m 112m 109m 3880 3540 S 12.9 2.8 11:52.47 postgres: dbtest test 10.255.100.65(57470) idle Date 29/06/2009 top - 10:37:11 up 21 days, 10:25, 1 user, load average: 1.50, 1.60, 1.46 Tasks: 130 total, 3 running, 126 sleeping, 0 stopped, 1 zombie Cpu(s): 13.3% us, 1.2% sy, 0.0% ni, 84.4% id, 0.7% wa, 0.2% hi, 0.2% si Mem: 4107392k total, 4103184k used, 4208k free,49036k buffers Swap: 2031608k total, 592k used, 2031016k free, 3698156k cached PID USER PR NI VIRT SWAP RES SHR DATA CODE S %CPU %MEMTIME+ COMMAND 9943 postgres 15 0 994m 33m 960m 818m 143m 3540 S 29.5 23.9 48:19.96 postgres: dbtest test 10.255.100.73(4796) idle 32731 postgres 16 0 854m 666m 188m 184m 3888 3540 R 25.5 4.7 25:03.44 postgres: dbtest test 10.255.100.65(57470) PARSE Date 29/06/2009 top - 19:05:03 up 21 days, 18:53, 1 user, load average: 0.95, 0.91, 0.90 Tasks: 131 total, 1 running, 129 sleeping, 0 stopped, 1 zombie Cpu(s): 9.2% us, 0.5% sy, 0.0% ni, 88.7% id, 1.2% wa, 0.3% hi, 0.2% si Mem: 4107392k total, 4094680k used,12712k free,18320k buffers Swap: 2031608k total, 592k used, 2031016k free, 3331036k cached PID USER PR NI VIRT RES SHR CODE DATA S %CPU %MEMTIME+ COMMAND 9943 postgres 16 0 1366m 1.3g 818m 3540 515m S 31.2 33.2 192:20.61 postgres: dbtest test 10.255.100.73(4796) SELECT 32731 postgres 16 0 853m 305m 302m 3540 3176 S 0.0 7.6 47:38.95 postgres: dbtest test 10.255.100.65(57470) idle Date 30/06/2009 top - 07:41:43 up 22 days, 7:30, 1 user, load average: 0.60, 0.75, 1.16 Tasks: 136 total, 2 running, 133 sleeping, 0 stopped, 1 zombie Cpu(s): 6.6% us, 0.9% sy, 0.0% ni, 91.7% id, 0.3% wa, 0.3% hi, 0.2% si Mem: 4107392k total, 4101088k used, 6304k free,18480k buffers Swap: 2031608k total, 592k used, 2031016k free, 2971740k cached PID USER PR NI VIRT SWAP RES SHR DATA CODE S %CPU %MEMTIME+ COMMAND 9943 postgres 17 0 1724m 30m 1.7g 821m 873m 3540 R 27.2 42.2 325:54.83 postgres: citgis citgis 10.255.100.73(4796) SELECT 32731 postgres 16 0 853m 500m 353m 350m 2980 3540 S 0.0 8.8 61:25.21 postgres: citgis citgis 10.255.100.65(57470) idle 2009/6/30 Scott Marlowe scott.marl...@gmail.com On Mon, Jun 29, 2009 at 6:14 PM, Anderson Valadaresanderva...@gmail.com wrote: Hi all I have a software developed in Delphi as a Windows Service, but, i don't know why, it consumns an unexpected large system memory (515m). The service access PostgresSQL by ODBC driver (psqlodbc_08_03_0400) and it consist simply of a loop calling a procedure PL/PGSQL. How to discover what is causing or why this high memory usage ? What objects are being used on this session ? PID USER PR NI VIRT SWAP RES SHR DATA CODE S %CPU %MEM TIME+ COMMAND 9943 postgres 15 0 860m 41m 819m 811m 9604 3540 D 88.3 20.4 0:08.33 postgres: dbtest test 10.255.100.73(4796) SELECT 32731 postgres 16 0 854m 741m 112m 109m 3880 3540 S 12.9 2.8 11:52.47 postgres: dbtest test 10.255.100.65(57470) idle Generally speaking, the actual delta for memory usage is the res - shared memory, which puts both of those backends at using an individual amount of memory at somewhere in the 5 to 8 meg range. The rest is shared memory, including shared_buffers and such. Seeing as you say your shared_buffers is 512M, I'm not sure where the rest of the shared memory is coming from here in top. Mem: 4107392k total, 4103184k used, 4208k free,49036k buffers Swap: 2031608k total, 592k used, 2031016k free, 3698156k cached Note that your machine is still showing 3.6G or so used for caching our of 4G, so you're only using an actual amount of about 400 Meg Are you having any measurable performance issues, or just curious / worried about what seems like high memory usage? Your numbers look pretty normal to me otherwise.
[GENERAL] High consumns memory
Hi all I have a software developed in Delphi as a Windows Service, but, i don't know why, it consumns an unexpected large system memory (515m). The service access PostgresSQL by ODBC driver (psqlodbc_08_03_0400) and it consist simply of a loop calling a procedure PL/PGSQL. How to discover what is causing or why this high memory usage ? What objects are being used on this session ? Software developed in Delphi 7 as a windows service. PostgresSQL 8.3.6 Database with PostGis extension Server p52a S.O.: Red Hat Enterprise Linux AS release 4 (Nahant Update 1) linux 2.6.9-11.EL #1 SMP ppc64 ppc64 ppc64 GNU/Linux S.O. information Date 29/06/2009 top - 07:58:49 up 21 days, 7:47, 1 user, load average: 0.73, 0.74, 0.71 Tasks: 131 total, 1 running, 129 sleeping, 0 stopped, 1 zombie Cpu(s): 13.2% us, 1.3% sy, 0.0% ni, 83.1% id, 1.9% wa, 0.2% hi, 0.2% si Mem: 4107392k total, 3764272k used, 343120k free,24760k buffers Swap: 2031608k total, 592k used, 2031016k free, 354k cached PID USER PR NI VIRT SWAP RES SHR DATA CODE S %CPU %MEMTIME+ COMMAND 9943 postgres 15 0 860m 41m 819m 811m 9604 3540 D 88.3 20.4 0:08.33 postgres: dbtest test 10.255.100.73(4796) SELECT 32731 postgres 16 0 854m 741m 112m 109m 3880 3540 S 12.9 2.8 11:52.47 postgres: dbtest test 10.255.100.65(57470) idle Date 29/06/2009 top - 10:37:11 up 21 days, 10:25, 1 user, load average: 1.50, 1.60, 1.46 Tasks: 130 total, 3 running, 126 sleeping, 0 stopped, 1 zombie Cpu(s): 13.3% us, 1.2% sy, 0.0% ni, 84.4% id, 0.7% wa, 0.2% hi, 0.2% si Mem: 4107392k total, 4103184k used, 4208k free,49036k buffers Swap: 2031608k total, 592k used, 2031016k free, 3698156k cached PID USER PR NI VIRT SWAP RES SHR DATA CODE S %CPU %MEMTIME+ COMMAND 9943 postgres 15 0 994m 33m 960m 818m 143m 3540 S 29.5 23.9 48:19.96 postgres: dbtest test 10.255.100.73(4796) idle 32731 postgres 16 0 854m 666m 188m 184m 3888 3540 R 25.5 4.7 25:03.44 postgres: dbtest test 10.255.100.65(57470) PARSE Date 29/06/2009 top - 19:05:03 up 21 days, 18:53, 1 user, load average: 0.95, 0.91, 0.90 Tasks: 131 total, 1 running, 129 sleeping, 0 stopped, 1 zombie Cpu(s): 9.2% us, 0.5% sy, 0.0% ni, 88.7% id, 1.2% wa, 0.3% hi, 0.2% si Mem: 4107392k total, 4094680k used,12712k free,18320k buffers Swap: 2031608k total, 592k used, 2031016k free, 3331036k cached PID USER PR NI VIRT RES SHR CODE DATA S %CPU %MEMTIME+ COMMAND 9943 postgres 16 0 1366m 1.3g 818m 3540 515m S 31.2 33.2 192:20.61 postgres: dbtest test 10.255.100.73(4796) SELECT 32731 postgres 16 0 853m 305m 302m 3540 3176 S 0.0 7.6 47:38.95 postgres: dbtest test 10.255.100.65(57470) idle As shown in column DATA(PID 9943) on 07:58:49 and on 19:05:03(515m) been a significant increase in the consumption of memory. postgresql.conf information: name |setting | unit -+--+-- archive_mode| on | autovacuum_analyze_scale_factor | 0.4 | autovacuum_analyze_threshold| 500 | autovacuum_vacuum_threshold | 1000 | checkpoint_segments | 15 | checkpoint_timeout | 1800 | s default_statistics_target | 50 | effective_cache_size| 249600 | 8kB fsync | on | logging_collector | on | maintenance_work_mem| 409600 | kB max_connections | 100 | max_fsm_pages | 3458000 | shared_buffers | 64000| 8kB wal_buffers | 100 | 8kB work_mem| 5120 | kB
Re: [GENERAL] High consumns memory
On Mon, Jun 29, 2009 at 6:14 PM, Anderson Valadaresanderva...@gmail.com wrote: Hi all I have a software developed in Delphi as a Windows Service, but, i don't know why, it consumns an unexpected large system memory (515m). The service access PostgresSQL by ODBC driver (psqlodbc_08_03_0400) and it consist simply of a loop calling a procedure PL/PGSQL. How to discover what is causing or why this high memory usage ? What objects are being used on this session ? PID USER PR NI VIRT SWAP RES SHR DATA CODE S %CPU %MEM TIME+ COMMAND 9943 postgres 15 0 860m 41m 819m 811m 9604 3540 D 88.3 20.4 0:08.33 postgres: dbtest test 10.255.100.73(4796) SELECT 32731 postgres 16 0 854m 741m 112m 109m 3880 3540 S 12.9 2.8 11:52.47 postgres: dbtest test 10.255.100.65(57470) idle Generally speaking, the actual delta for memory usage is the res - shared memory, which puts both of those backends at using an individual amount of memory at somewhere in the 5 to 8 meg range. The rest is shared memory, including shared_buffers and such. Seeing as you say your shared_buffers is 512M, I'm not sure where the rest of the shared memory is coming from here in top. Mem: 4107392k total, 4103184k used, 4208k free, 49036k buffers Swap: 2031608k total, 592k used, 2031016k free, 3698156k cached Note that your machine is still showing 3.6G or so used for caching our of 4G, so you're only using an actual amount of about 400 Meg Are you having any measurable performance issues, or just curious / worried about what seems like high memory usage? Your numbers look pretty normal to me otherwise. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] High consumns memory
Scott the problem is that the memory gets higher and higher each PL/SQL procedure call. Some “I don’t know what” is not been freed(released) from the memory after execution. There’s any way that I can see what is allocated and released when the PL/SQL procedure is called or finished ? 2009/3/31 Scott Marlowe scott.marl...@gmail.com On Tue, Mar 31, 2009 at 5:44 PM, Anderson Valadares anderva...@gmail.com wrote: I have a software developed in Delphi as a Windows Service, but, i don't know why, it consumns an unexpected large system memory (1.3g). The service access PostgresSQL by ODBC driver (psqlodbc_08_03_0400) and it consist simply of a loop calling a procedure PL/PGSQL. How to discover what is causing or why this high memory usage ? What objects are being used on this session ? Software developed in Delphi 7 as a windows service. PostgresSQL 8.3.6 Database with PostGis extension Server p52a S.O.: Red Hat Enterprise Linux AS release 4 (Nahant Update 1) linux 2.6.9-11.EL #1 SMP ppc64 ppc64 ppc64 GNU/Linux S.O. information top - 11:39:15 up 6 days, 19:15, 1 user, load average: 2.15, 2.02, 1.86 Tasks: 127 total, 1 running, 126 sleeping, 0 stopped, 0 zombie Cpu(s): 9.5% us, 2.6% sy, 0.0% ni, 71.2% id, 16.3% wa, 0.1% hi, 0.2% si Mem: 4107392k total, 4101520k used, 5872k free,17708k buffers Swap: 2031608k total, 244k used, 2031364k free, 3091708k cached PID USER PR NI VIRT RES SHR S %CPU %MEMTIME+ COMMAND 32662 postgres 16 0 1317m 1.3g 516m D 52.5 32.1 349:57.48 postgres 8953 postgres 17 0 548m 482m 479m S 33.5 12.0 2:50.09 postgres 1944 postgres 16 0 550m 520m 516m S 7.3 13.0 165:30.47 postgres 32659 postgres 15 0 544m 516m 514m S 1.3 12.9 16:42.60 postgres 1935 postgres 15 0 543m 514m 513m S 1.0 12.8 15:15.56 postgres This doesn't look bad at all. The pgsql instances are using a pretty reasonable amount of memory for caching (somewhere in the 512Meg range) and one long running query is using a lot more memory (in the 600M range) Your machine has 3G of cache out of 4G of ram, and it's using almost not swap. Now, when this is running next time, using psql, try something like: select * from pg_stat_activity where procpid=32662; or whatever pid is using up a fair chunk of memory to see the query that's doing it.
Re: [GENERAL] High consumns memory
On Wed, Apr 1, 2009 at 12:59 PM, Anderson Valadares anderva...@gmail.com wrote: Scott the problem is that the memory gets higher and higher each PL/SQL procedure call. Some “I don’t know what” is not been freed(released) from the memory after execution. There’s any way that I can see what is allocated and released when the PL/SQL procedure is called or finished ? I think you just aren't familiar with how memory is accounted for in top. Honestly, nothing looks out of place there. Do you know VIRT RES and SHR mean in top? There's a good post here that explains it for the most part: http://www.kdedevelopers.org/node/1445 -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
[GENERAL] High consumns memory
I have a software developed in Delphi as a Windows Service, but, i don't know why, it consumns an unexpected large system memory (1.3g). The service access PostgresSQL by ODBC driver (psqlodbc_08_03_0400) and it consist simply of a loop calling a procedure PL/PGSQL. How to discover what is causing or why this high memory usage ? What objects are being used on this session ? Software developed in Delphi 7 as a windows service. PostgresSQL 8.3.6 Database with PostGis extension Server p52a S.O.: Red Hat Enterprise Linux AS release 4 (Nahant Update 1) linux 2.6.9-11.EL #1 SMP ppc64 ppc64 ppc64 GNU/Linux S.O. information top - 11:39:15 up 6 days, 19:15, 1 user, load average: 2.15, 2.02, 1.86 Tasks: 127 total, 1 running, 126 sleeping, 0 stopped, 0 zombie Cpu(s): 9.5% us, 2.6% sy, 0.0% ni, 71.2% id, 16.3% wa, 0.1% hi, 0.2% si Mem: 4107392k total, 4101520k used, 5872k free,17708k buffers Swap: 2031608k total, 244k used, 2031364k free, 3091708k cached PID USER PR NI VIRT RES SHR S %CPU %MEMTIME+ COMMAND 32662 postgres 16 0 1317m 1.3g 516m D 52.5 32.1 349:57.48 postgres 8953 postgres 17 0 548m 482m 479m S 33.5 12.0 2:50.09 postgres 1944 postgres 16 0 550m 520m 516m S 7.3 13.0 165:30.47 postgres 32659 postgres 15 0 544m 516m 514m S 1.3 12.9 16:42.60 postgres 1935 postgres 15 0 543m 514m 513m S 1.0 12.8 15:15.56 postgres postgresql.conf information: name |setting | unit -+--+-- archive_command | wal_archive_command.sh %p %f | archive_mode| on | autovacuum_analyze_scale_factor | 0.4 | autovacuum_analyze_threshold| 500 | autovacuum_vacuum_threshold | 1000 | checkpoint_segments | 15 | checkpoint_timeout | 1800 | s DateStyle | ISO, DMY | default_statistics_target | 50 | effective_cache_size| 249600 | 8kB fsync | on | lc_monetary | en_US.UTF-8 | lc_numeric | en_US.UTF-8 | lc_time | en_US.UTF-8 | listen_addresses| *| log_autovacuum_min_duration | 0| ms log_checkpoints | on | log_destination | stderr | log_directory | /p01/log | log_filename| postgresql-%Y-%m-%d_%H%M%S.log | log_line_prefix | %t [%p]: [%l-1] | log_lock_waits | on | log_min_duration_statement | 250 | ms log_min_error_statement | error| log_rotation_age| 1440 | min log_rotation_size | 20480| kB log_temp_files | 10240| kB logging_collector | on | maintenance_work_mem| 409600 | kB max_connections | 100 | max_fsm_pages | 3458000 | shared_buffers | 64000| 8kB tcp_keepalives_idle | 0| s wal_buffers | 100 | 8kB work_mem| 5120 | kB
Re: [GENERAL] High consumns memory
On Tue, Mar 31, 2009 at 5:44 PM, Anderson Valadares anderva...@gmail.com wrote: I have a software developed in Delphi as a Windows Service, but, i don't know why, it consumns an unexpected large system memory (1.3g). The service access PostgresSQL by ODBC driver (psqlodbc_08_03_0400) and it consist simply of a loop calling a procedure PL/PGSQL. How to discover what is causing or why this high memory usage ? What objects are being used on this session ? Software developed in Delphi 7 as a windows service. PostgresSQL 8.3.6 Database with PostGis extension Server p52a S.O.: Red Hat Enterprise Linux AS release 4 (Nahant Update 1) linux 2.6.9-11.EL #1 SMP ppc64 ppc64 ppc64 GNU/Linux S.O. information top - 11:39:15 up 6 days, 19:15, 1 user, load average: 2.15, 2.02, 1.86 Tasks: 127 total, 1 running, 126 sleeping, 0 stopped, 0 zombie Cpu(s): 9.5% us, 2.6% sy, 0.0% ni, 71.2% id, 16.3% wa, 0.1% hi, 0.2% si Mem: 4107392k total, 4101520k used, 5872k free, 17708k buffers Swap: 2031608k total, 244k used, 2031364k free, 3091708k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 32662 postgres 16 0 1317m 1.3g 516m D 52.5 32.1 349:57.48 postgres 8953 postgres 17 0 548m 482m 479m S 33.5 12.0 2:50.09 postgres 1944 postgres 16 0 550m 520m 516m S 7.3 13.0 165:30.47 postgres 32659 postgres 15 0 544m 516m 514m S 1.3 12.9 16:42.60 postgres 1935 postgres 15 0 543m 514m 513m S 1.0 12.8 15:15.56 postgres This doesn't look bad at all. The pgsql instances are using a pretty reasonable amount of memory for caching (somewhere in the 512Meg range) and one long running query is using a lot more memory (in the 600M range) Your machine has 3G of cache out of 4G of ram, and it's using almost not swap. Now, when this is running next time, using psql, try something like: select * from pg_stat_activity where procpid=32662; or whatever pid is using up a fair chunk of memory to see the query that's doing it. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general