Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.4
-
None
-
Linux Mint 8 Helena - Universal Edition
Linux version 2.6.31-14-generic (buildd@rothera) (gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu8) ) #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009
java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) Client VM (build 14.1-b02, mixed mode, sharing)Linux Mint 8 Helena - Universal Edition Linux version 2.6.31-14-generic (buildd@rothera) (gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu8) ) #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 java version "1.6.0_15" Java(TM) SE Runtime Environment (build 1.6.0_15-b03) Java HotSpot(TM) Client VM (build 14.1-b02, mixed mode, sharing)
Description
In my program, I am using a BasicDataSource to get my database connections. I have to keep one of the connection alive and thus never close it. On this connection, I have to periodically get the metadata (call the getMetaData() method) for my processing.
However, I have noticed that each call to this method create a new DelegatingDatabaseMetaData instance which can't be garbage collected until the connection is closed. This creation of DelegatingDatabaseMetaData will finally consume all the memory and generate a OutOfMemory error.
Actually, in it's constructor, the DelegatingDatabaseMetaData class calls its super constructor (from the AbandonedTrace class) which creates a reference (parent.addTrace(this) from the connection to the DelegatingDatabaseMetaData. This reference prevent the DelegatingDatabaseMetaData to be collected until the Connection is closed.
Attachments
Issue Links
- blocks
-
DBCP-352 Repeated calls to getMetadata in a transaction leads to performance degredation
- Closed