OutOfMemoryError
Posted by: Duy Nguyen
Date: March 10, 2006 09:07PM

Hi,
I am using MySQL Server 4.1, and Connector J 3.1.6 jar file.

I've created a Java Swing GUI for an application that needs to connect to 22 databases. On the GUI, there is a JTable that displays the data from the database tables in those 22 databases.

The JTable has 22 rows and 9 columns. Each row of the JTable displays data that obtain from 4 database tables in one database. I have to run 9 queries to get 9 result sets for each row of the JTable. The query just simply "SELECT COUNT(*) FROM A" or "SELECT SUM(...) FROM B". The 9 result sets then are displayed to 9 columns of the JTable. Then I do the same thing for other rows of JTable.

I have to create 22 database connections to 22 different databases. Each row requires 9 queries. So the total queries are 22*9=198 queries.

The requirement is that I have to poll 22 databases every 10 seconds to update the JTable cells because the application is running in real time.

After 30 minutes, I got the OutOfMemoryError Exception. I followed MySQL Connector J JDBC API implementation notes to create a Statement with ResultSet.TYPE_FORWARD_ONLY, ..., close the result set and statement after each use and use Java Soft Reference to avoid memory leak each time I refresh the JTable but I still fail.

Please give me some advices.

Thank you.

Duy

Options: ReplyQuote


Subject
Written By
Posted
OutOfMemoryError
March 10, 2006 09:07PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.