Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Garbage collection in JDBC

 
pradeep andhra
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4020
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
pradeep andhra
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic