From: | "yoursoft(at)freemail(dot)hu" <yoursoft(at)freemail(dot)hu> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | PostgreSQL memory bug |
Date: | 2004-12-07 07:55:54 |
Message-ID: | 41B5620A.1070202@freemail.hu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Dear Developer Team!
I use the PostgreSQL 7.4.5 on SLES9.0 and PostgreSQL 7.4.3 on SuSE 9.0
(I think this problem exists in 8.0 too).
If you make 'create user' and 'alter group' sql command on existing
users, and make it many times, the server doesn't release the memory.
After 6-7000 calls the server is crashed with an 'out of memory' error.
In 7.4.5 the logfile contains: 'out of memory error', and postmaster.pid
file is deleted.
In 7.4.3 the logfile doesn't contain: 'out of memory error', and
postmaster.pid file exists. After deleting the postmaster.pid, and
making a 'pg_ctl start' the psql can't connect to the database, only
after a full reboot.
I made a Java program to demonstrate the problem (CreateUsers.java):
//-----------------------------------------
import java.sql.*;
public class CreateUsers {
public CreateUsers() {
}
public static void main(String[] args) {
Statement loc_sql = null;
StringBuffer loc_sqlString = null;
Connection loc_db = null;
ResultSet loc_eredmeny = null;
try {
Class.forName("org.postgresql.Driver"); //load the driver
for (int i=0; i<20000; i++) {
loc_db =
DriverManager.getConnection("jdbc:postgresql://127.0.0.1/anything",
"postgres", "password");
loc_sql = loc_db.createStatement();
try {
loc_sqlString = new StringBuffer("CREATE USER ");
loc_sqlString.append( "anybody" );
loc_sqlString.append( " WITH PASSWORD '" );
loc_sqlString.append( "anything" );
loc_sqlString.append( "' NOCREATEDB NOCREATEUSER" );
loc_sql.executeUpdate( loc_sqlString.toString() );
} catch (Exception e2) {
}
try {
loc_sqlString = new StringBuffer("ALTER GROUP ");
loc_sqlString.append( "admin" );
loc_sqlString.append( " ADD USER ");
loc_sqlString.append( "anybody" );
loc_sql.executeUpdate( loc_sqlString.toString() );
} catch(Exception e){ }
loc_db.close();
System.out.println(String.valueOf(i));
}
} catch (Exception e) {
System.out.println(e.toString());
}
}
}
//-----------------------------------------
If you have any further questions please mail to me.
Best regards:
Ferenc
From | Date | Subject | |
---|---|---|---|
Next Message | PostgreSQL Bugs List | 2004-12-07 10:20:22 | BUG #1344: Locale problem |
Previous Message | Sean Chittenden | 2004-12-07 07:51:14 | Feature request: ALTER TABLE tbl SET STATISTICS... |