File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Garbage collection in JDBC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Garbage collection in JDBC" Watch "Garbage collection in JDBC" New topic
Author

Garbage collection in JDBC

pradeep andhra
Greenhorn

Joined: Sep 18, 2006
Posts: 9
Hi Ranchers,

I am doing a JProbe testing on a use-case. Inspite of closing all open resources (resultset and PreparedJDBCStatement) , the snapshot(Jprobe) reports instances of OracleStatement on the heap. The memory of this is considerably high . I wish to know why these instances were not garbage collected by the JVM. The application uses Oracle type 4 driver.

The instance view detail lists a number of
T4CNumberAccessorXXXXXXX(rowSpaceChar). What is this?

Requesting replies ASAP!. Thanks in advance

Regards,
JavaGuru
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3710
    
    5

Did you close the database connections themselves?

I think your issues might fall under the category of general garbage collection such as is there still a reference to these objects anywhere in the system, have you tried calling System.gc() after making large calls, and are trying to load more data into memory than available.

Also, have you tried using connection pooling?


My Blog: Down Home Country Coding with Scott Selikoff
pradeep andhra
Greenhorn

Joined: Sep 18, 2006
Posts: 9
Hi Scott,

Yes I am using connection pooling here and regarding System.gc(), I believe Jprobe itself will force a GC on the use-case before collecting the snapshot. Even the resources are explicitly closed.

Regards,
JavaGuru
 
GeeCON Prague 2014
 
subject: Garbage collection in JDBC