[ https://issues.apache.org/jira/browse/MNEMONIC-215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15896743#comment-15896743 ]
Wang, Gang commented on MNEMONIC-215: ------------------------------------- Option 1 looks more dedicated and reasonable as a solution to fix this issue. because if autoreclaim flag of next node is true, it could make it to be destroyed automatically in cascade way if no more reference on the next node, the user is supposed to take care of the next node if they don't want it to be reclaimed automatically. In addition, the destroy() might restore its next node before destroying itself to make sure the autoreclaim flag has been passed to the next node. > Memory leak when LinkedList element is destroyed > ------------------------------------------------ > > Key: MNEMONIC-215 > URL: https://issues.apache.org/jira/browse/MNEMONIC-215 > Project: Mnemonic > Issue Type: Bug > Reporter: Johnu George > Assignee: Wang, Gang > Priority: Critical > Fix For: 0.6.0-incubating > > > Here is the implementation of the destroy function in LinkedList node > @Override > public void destroy() throws RetrieveDurableEntityError { > m_holder.destroy(); > if (null != m_item) { > m_item.destroy(); > m_item = null; > } > if (null != m_next) { > m_next.destroy(); > m_next = null; > } > } > Next is destroyed only when m_next is not null. m_next can also be null if > next item is not loaded into memory from PMem. It is required to first > restore the item using getNext and then call destroy. -- This message was sent by Atlassian JIRA (v6.3.15#6346)