Memory is not released if output of abend messages is interrupted by Ctrl-C (when trying to establish multiple attachments using Jaybird) -----------------------------------------------------------------------------------------------------------------------------------------
Key: CORE-4858 URL: http://tracker.firebirdsql.org/browse/CORE-4858 Project: Firebird Core Issue Type: Bug Components: Engine Affects Versions: 3.0 RC 1 Reporter: Pavel Zotov This ticket has been created as separate issue after suggestion by Sean. Originally it was part of core-4857. Consider following java class: === begin === import java.sql.*; import org.firebirdsql.jdbc.*; public class MultipleAttaches { private static final String URL = "jdbc:firebirdsql://localhost:3333/e30"; private static final String USR = "SYSDBA"; private static final String PSW = "masterke"; public static void main(String[] args) { FirebirdConnection[] ca = new FirebirdConnection[ 2000 ]; long ms; for(int i=0; i < ca.length; i++ ) { try { ms = System.currentTimeMillis(); ca[i] = (FirebirdConnection)java.sql.DriverManager.getConnection(URL, USR, PSW); System.out.printf( "\nEtsablished connection %4d at %6d ms", 1+i, System.currentTimeMillis() - ms ); } catch (Exception x) { x.printStackTrace(); // System.exit(1); --------------------------------- [ 1 ] } } try { Thread.sleep(1000000); } catch (InterruptedException e) { } } } === end === Note that statement [1] (i.e. `System.exit(1);` ) is commented. When this script will be compiled and launched on host with OS = Win XP and RAM = 2 Gb and FB-3 installed and running as SuperServer, one may to explore that there will be huge memory consumption by FB process. After reaching approx. 1500 attachments bulk of messages will appeared with text like this: === org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544430. unable to allocate memory from o perating system at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:123) at org.firebirdsql.jdbc.AbstractDriver.connect(AbstractDriver.java:126) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at MultipleAttaches.main(MultipleAttaches.java:20) Caused by: org.firebirdsql.gds.GDSException: unable to allocate memory from operating system at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.readStatusVector(AbstractJavaGDSImpl.java:2092) . . . === If output of these messages will be interrupted by pressing Ctrl-C, memory will not returned to OS and FB will be inaccessible infinite time. Steps to reproduce (assuming that JRE was installed): 1) correct values of constants URL, USR and PSW to yours. 2) download jaybird-full-2.x.x.jar and save it to the c:\temp\ 3) create environment variable with the name = CLASSPATH and value = .;c:\temp\* // note about leading dot and trailing asterisk 4) compile: javac MultipleAttaches.java // output should be empty 5) running: java MultipleAttaches). -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel