General Bug Report: This message appears "malloc: cannot allocate memory"

From: Unprivileged user <nobody>
To: pgsql-bugs(at)postgreSQL(dot)org
Subject: General Bug Report: This message appears "malloc: cannot allocate memory"
Date: 1999-07-21 16:58:01
Message-ID: 199907211658.MAA38745@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Edmund P. Morgan
Your email address : emorgan(at)southfield(dot)cups(dot)com

Category : runtime: back-end: SQL
Severity : critical

Summary: This message appears "malloc: cannot allocate memory"

System Configuration
--------------------
Operating System : Linux RedHat 5.2 & 5.0

PostgreSQL version : 6.3.1 and 6.2.1

Compiler used : gcc 2.7 +

Hardware:
---------
Pentium 400 Mhz, 128 Ram, 10 GB hard disk, the database resides on the first partition 4.0 GB

Versions of other tools:
------------------------

--------------------------------------------------------------------------

Problem Description:
--------------------
I created a database and one table that contains about nine fields. The record size is less that 810 bytes. The table contains 500,000 rows. When enter this sql statement "select * from ptest", the following message is displayed
"malloc: cannot allocate memory". This select statement uses all but 1024K of physical memory and all of the virtual
memory (hard disk space) before the process can't allocate
any more memory. Is the back-end database process
(utils/mmgr) trying to return the entire dataset? This
process should be returning the max amount of configurable
memory (ie: 32 MB) per dataset until all of the rows have
been retrieved. Is there a configurable switch to set to
allow the datasets to be buffered.

--------------------------------------------------------------------------

Test Case:
----------
The following is the table layout:

create table test
(
relrec int4,
dum1 char(100),
dum2 char(100),
dum3 char(100),
dum4 char(100),
dum5 char(100),
dum6 char(100),
dum7 char(100),
dum8 char(100)
);

--------------------------------------------------------------------------

Solution:
---------
Set aside a configuable buffer memory switch that the
datasets will use the max. buffer size the switch is set to.
The database process will use this buffer size until all
rows are returned.

--------------------------------------------------------------------------

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 1999-07-22 00:45:01 Dropped connection during COPY causes trouble
Previous Message Marek Mintal 1999-07-20 10:01:10 sql rules bug