
|
If you were logged in you would be able to see more operations.
|
|
|
| Bug behavior facts: |
Regression
|
| Resolution Date: |
07/Apr/08 08:50 AM
|
|
Retrieving from a large table with lobs gives an OutOfMemoryException, even if free() is explictly called on the lob. I believe this is because EmbedConnection.addLobMapping is called for every lob creation but is never cleared until commit or rollback, even if the lob is freed.
|
|
Description
|
Retrieving from a large table with lobs gives an OutOfMemoryException, even if free() is explictly called on the lob. I believe this is because EmbedConnection.addLobMapping is called for every lob creation but is never cleared until commit or rollback, even if the lob is freed.
|
Show » |
| Repository |
Revision |
Date |
User |
Message |
| ASF |
#644755 |
Fri Apr 04 16:19:19 UTC 2008 |
oysteing |
DERBY-3354: Select from large lob table with embedded gives OutOfMemoryError
Contributed by Anurag.
This patch introduces a new WeakHashMap in EmbedConnection. EmbedBlob and EmbedClob objects references are stored in this
map (objects as key and null as value). Adding entry to locater map is
differed till the first call of getLocater.
This ensures that there is entry of LOB objects in locater map if they are invoked in embedded mode.
As the keys of WeakHashMap doesn't prevents the objects from being
garbage collected, once the lob objects are unreferenced lob objects will
be garbage collected releasing the memory.
During commit/rollback or Connection.close, free is invoked on all the lob
objects from WeakHashMap and the map is cleared.
Modified files
java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
Added a new attribute lobRefrences of type WeakHashMap.
Added a new method addLOBReference to make an entry in new
hash map.
Modified clearLOBMapping to use lobRefrences to fetch and invoke free on lob objects instead of lobHashMap.
java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java
java/engine/org/apache/derby/impl/jdbc/EmbedClob.java
Modified constructs to call connection.lobRefrences instead of conn.addLOBMapping.
Modified getLocater method to check if the locater value is non zero
before returning and if its zero calling conn.addLOBMapping to make
entry of lob objects and getting locater value.
Calling removeLOBMapping in free method.
Cleanup of temporary file is already being taken care by the finalizer of
LOBStreamControl so I haven't added any new cleanup code for
finalizer.
|
| Files Changed |
MODIFY
/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java
|
| Repository |
Revision |
Date |
User |
Message |
| ASF |
#644764 |
Fri Apr 04 16:40:25 UTC 2008 |
oysteing |
DERBY-3354: Select from large lob table with embedded gives OutOfMemoryError
Contributed by Anurag.
This patch introduces a new WeakHashMap in EmbedConnection. EmbedBlob and EmbedClob objects references are stored in this
map (objects as key and null as value). Adding entry to locater map is
differed till the first call of getLocater.
This ensures that there is entry of LOB objects in locater map if they are invoked in embedded mode.
As the keys of WeakHashMap doesn't prevents the objects from being
garbage collected, once the lob objects are unreferenced lob objects will
be garbage collected releasing the memory.
During commit/rollback or Connection.close, free is invoked on all the lob
objects from WeakHashMap and the map is cleared.
Modified files
java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
Added a new attribute lobRefrences of type WeakHashMap.
Added a new method addLOBReference to make an entry in new
hash map.
Modified clearLOBMapping to use lobRefrences to fetch and invoke free on lob objects instead of lobHashMap.
java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java
java/engine/org/apache/derby/impl/jdbc/EmbedClob.java
Modified constructs to call connection.lobRefrences instead of conn.addLOBMapping.
Modified getLocater method to check if the locater value is non zero
before returning and if its zero calling conn.addLOBMapping to make
entry of lob objects and getting locater value.
Calling removeLOBMapping in free method.
Cleanup of temporary file is already being taken care by the finalizer of
LOBStreamControl so I haven't added any new cleanup code for
finalizer.
|
| Files Changed |
MODIFY
/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
MODIFY
/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java
MODIFY
/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java
|
| Repository |
Revision |
Date |
User |
Message |
| ASF |
#644916 |
Fri Apr 04 20:59:38 UTC 2008 |
oysteing |
DERBY-3354: Select from large lob table with embedded gives OutOfMemoryError
Contributed by Anurag.
Merged to 10.4 branch with command:
svn merge -r644763:644764 https://svn.apache.org/repos/asf/db/derby/code/trunk/
This patch introduces a new WeakHashMap in EmbedConnection. EmbedBlob and EmbedClob objects references are stored in this
map (objects as key and null as value). Adding entry to locater map is
differed till the first call of getLocater.
This ensures that there is entry of LOB objects in locater map if they are invoked in embedded mode.
As the keys of WeakHashMap doesn't prevents the objects from being
garbage collected, once the lob objects are unreferenced lob objects will
be garbage collected releasing the memory.
During commit/rollback or Connection.close, free is invoked on all the lob
objects from WeakHashMap and the map is cleared.
Modified files
java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
Added a new attribute lobRefrences of type WeakHashMap.
Added a new method addLOBReference to make an entry in new
hash map.
Modified clearLOBMapping to use lobRefrences to fetch and invoke free on lob objects instead of lobHashMap.
java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java
java/engine/org/apache/derby/impl/jdbc/EmbedClob.java
Modified constructs to call connection.lobRefrences instead of conn.addLOBMapping.
Modified getLocater method to check if the locater value is non zero
before returning and if its zero calling conn.addLOBMapping to make
entry of lob objects and getting locater value.
Calling removeLOBMapping in free method.
Cleanup of temporary file is already being taken care by the finalizer of
LOBStreamControl so I haven't added any new cleanup code for
finalizer.
|
| Files Changed |
MODIFY
/db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
MODIFY
/db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java
MODIFY
/db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/jdbc/EmbedClob.java
|
|