dbTalk Databases Forums  

[BUGS] PostgreSQL memory bug

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] PostgreSQL memory bug in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
yoursoft@freemail.hu
 
Posts: n/a

Default [BUGS] PostgreSQL memory bug - 12-10-2004 , 05:31 PM






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("jdbcostgresql://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

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] PostgreSQL memory bug - 12-11-2004 , 10:34 AM






"yoursoft (AT) freemail (DOT) hu" <yoursoft (AT) freemail (DOT) hu> writes:
Quote:
I use the PostgreSQL 7.4.5 on SLES9.0 and PostgreSQL 7.4.3 on SuSE 9.0

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.
I believe this is the same issue already fixed in 7.4.6.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.