Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TY5vE-0002qv-GD for pgsql-performance@postgresql.org; Tue, 13 Nov 2012 02:08:16 +0000 Received: from outmail148095.authsmtp.com ([62.13.148.95]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TY5vC-0003EN-Tb for pgsql-performance@postgresql.org; Tue, 13 Nov 2012 02:08:15 +0000 Received: from mail-c193.authsmtp.com (mail-c193.authsmtp.com [62.13.128.118]) by punt8.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id qAD28Cxc006283; Tue, 13 Nov 2012 02:08:12 GMT Received: from ayaki.localdomain (124-148-90-153.dyn.iinet.net.au [124.148.90.153]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2) with ESMTP id qAD287K0048188 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 13 Nov 2012 02:08:10 GMT Message-ID: <50A1AB86.8020200@2ndQuadrant.com> Date: Tue, 13 Nov 2012 10:08:06 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 MIME-Version: 1.0 To: Wu Ming CC: pgsql-performance@postgresql.org Subject: Re: PostreSQL v9.2 uses a lot of memory in Windows XP References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Server-Quench: f9a0646e-2d36-11e2-95c0-002264978518 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZeVg0b BQteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksadBtFaQZbY1ZH HGQLWlZEUF97WWt/ agsfbAdZfEtKVxtj UFZIR1FNFgBqBAMA SF9vJht6cH5GeHp4 ZE5qEHVeWkw0I08s QkhQEzgbZzNjbn0e URVaagpRIwNXfh9H aFZ7XXQFZGQPKBg1 TUcABx0LExJlDREd egYWMUgfen8vViBt AUpKAC4iBgUMDyE0 M1QhJBYZEUMWKFR6 MF1pZlMePxgNEUVu JykA X-Authentic-SMTP: 61633235383639.1014:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 124.148.90.153/2525 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201211/146 X-Sequence-Number: 48512 On 11/12/2012 10:17 PM, Wu Ming wrote: > See this screenshot link from the Process Explorer: > > http://i45.tinypic.com/vr4t3b.png That looks pretty reasonable to me. The "virtual size" includes the shared memory segment, so the per-process use is actually much lower than it looks. The real use will be closer to one of the virtual sizes plus the working sets of all the rest of the processes. They are processes, not threads. There may be a genuine issue here, but it isn't demonstrated by the screenshot. How do you determine that it's "lagging"? What's the overall system memory pressure like? Check Task Manager. What's the system's swap usage? Are there other big processes? > You can see that there are a lot of threads spawned. Is the threads > that caused the high memory usage? PostgreSQL has a process-based architecture. They're processes not threads. Each process only uses a fairly small amount of memory - the exact amount depends on settings like work_mem and what the queries running are doing, but it's usually not much. Most of the apparent use is shared memory. -- Craig Ringer http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services