Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id C3D9BB5DC19 for ; Sat, 15 Oct 2011 00:43:36 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 72011-04 for ; Sat, 15 Oct 2011 03:43:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by mail.postgresql.org (Postfix) with ESMTP id 05D11B5DBC2 for ; Sat, 15 Oct 2011 00:43:35 -0300 (ADT) Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id p9F3hYc9061678 for ; Sat, 15 Oct 2011 03:43:34 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id p9F3hYfO061677; Sat, 15 Oct 2011 03:43:34 GMT (envelope-from www) Date: Sat, 15 Oct 2011 03:43:34 GMT Message-Id: <201110150343.p9F3hYfO061677@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #6256: loading small file eats all memory and crashes system From: "Rachael" Content-Type: text/plain; charset=utf-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 201110/124 X-Sequence-Number: 31394 The following bug has been logged online: Bug reference: 6256 Logged by: Rachael Email address: rulonrasp@gmail.com PostgreSQL version: 9.11 Operating system: Arch Linux Description: loading small file eats all memory and crashes system Details: While attempting to import a sql file, postgres eats all my physical memory (4GB) and swap file space(2GB). The file itself is a series of insert statements that is 10,000 rows by 100 columns wide. A smaller file (1000 rows) loads just fine. I'll be glad to provide sample files. The command I'm using is inside a perl script: print `psql $database $user < postgres.sql`; When the computer runs out of memory the process finally dies. The file itself is about 32MB in size. Even if this import needs a performance tweak in the conf file, this shouldn't exhaust all of the memory in the system before exiting. Log Output: LOG: unexpected EOF on client connection LOG: server process (PID 5280) was terminated by signal 9: Killed LOG: terminating any other active server processes WARNING: terminating connection because of crash of another server process DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory. HINT: In a moment you should be able to reconnect to the database and repeat your command. WARNING: terminating connection because of crash of another server process