[ 
https://issues.apache.org/jira/browse/OAK-2798?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14506725#comment-14506725
 ] 

Chetan Mehrotra commented on OAK-2798:
--------------------------------------

+1 to unset the array

bq. This can lead to memory leak as when IndexInputs gets closed, e.g. by 
StoredFieldsReaders such references won't be properly cleared (with probably a 
higher impact in cases where copyOnRead = true). 

Did not understand how it would have higher impact for copyOnRead as in that 
case I expect that OakIndexFile would not be used much. IndexCopier would use 
it for copy but then would not keep a reference to the input instance. So it 
would eventually get GC

> OakIndexInput should unset OakIndexFile's byte[] upon close
> -----------------------------------------------------------
>
>                 Key: OAK-2798
>                 URL: https://issues.apache.org/jira/browse/OAK-2798
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: lucene
>    Affects Versions: 1.2.1
>            Reporter: Tommaso Teofili
>             Fix For: 1.2.2
>
>
> {{OakIndexInput}}, being an extension of Lucene's {{IndexInput}} implements 
> {{Closable}}, however upon {{#close}} the referenced {{OakIndexFile}}'s 
> _byte[]_ is not unset.
> This can lead to memory leak as when IndexInputs gets closed, e.g. by 
> {{StoredFieldsReaders}} such references won't be properly cleared (with 
> probably a higher impact in cases where _copyOnRead = true_). 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to