craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > General QuickTable Support/Help Post New Topic   Post A Reply
memory leak printer friendly version
next newest post | next oldest post
Author Messages
rafalele
Unregistered
Edit or delete this message Reply w/Quote
Posted Tuesday, February 22, 2005 @ 08:25:45  

Hi, and thanks in advance.

I'm using the DBTable in a Swing MDI application.
My problem is that I have an JInternalFrame with only a DBTable.
When I close it, the window never reaches the finalize method.
The rest of my JInternalFrames in the application reach it after disposing them.
This behaviour leads me to a Memory Leak, as user can open many times the same window.

As an easy test I have made a new project with a new JInternalFrame with a DBTable
and load it using the dBTable.refresh(Vector) method, where the Vector is a Vector
of Vectors. It works OK. Loads the DBTable and closing the JInternalFrame throws the finalize method.

The next test was to set the type of a Date field column to java.util.Date type, changing the
default type used by the DBTable. I use the next two methods after getting the whole DBTable loaded:
dBTable.getColumn(4).setType(java.sql.Types.DATE);
dBTable.getColumn(4).setDateFormat("dd/MM/yyyy");
Where 4 is the index of the column that has the Date field.
Now the DBTable is correctly loaded and the column 4 now shows the desired date format. The problem is that
now the finalize method is not thrown after disposing the JInternalFrame.
Taking out the second line (dBTable.getColumn(4).setDateFormat("dd/MM/yyyy");) only makes the table to show
the default date format, but the finalize method is not thrown.

If you want I can send you my java test files to prove it.

Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Tuesday, February 22, 2005 @ 21:02:37  

If you have added any listeners to frame/dbtable, remove them before you close internal frame.

try setting yourDBTable = null; before closing internal frame.

Also refer following url for similar problems
http://forum.java.sun.com/thread.jspa?forumID=57&messageID=325385&threadID=123758

Email me a small sample code reproducing this problem, I will have a look at it.

Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios