[ 
https://issues.apache.org/jira/browse/DERBY-2700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Knut Anders Hatlen updated DERBY-2700:
--------------------------------------

    Attachment: 2700.diff

The attached patch (2700.diff) sets CachedItem.entry to null when it is marked 
as invalid. I have not run the full regression test suite, but I have verified 
(by monitoring the process with JConsole) that Derby is able to free a lot more 
memory after dropping a table with this patch.

> Invalid entries in the cache manager are not garbage collected until the 
> CachedItem is reused
> ---------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2700
>                 URL: https://issues.apache.org/jira/browse/DERBY-2700
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.2.1.6, 10.2.2.0, 10.3.0.0
>            Reporter: Knut Anders Hatlen
>         Assigned To: Knut Anders Hatlen
>         Attachments: 2700.diff
>
>
> When an entry in the cache manager becomes invalid (for instance because a 
> table is dropped), it cannot be garbage collected because we only set the 
> valid_ field in CachedItem to false. We should also set entry to null to make 
> the Cacheable eligible for garbage collection. Currently, invalid cached 
> objects cannot be garbage collected until their CachedItems are reused. This 
> causes Derby to hold on to resources too long, and can in the worst case lead 
> to an OutOfMemoryError.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to