You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2019/04/17 18:33:00 UTC

[jira] [Commented] (GEODE-6662) NioPlainEngine.ensureWrappedCapacity does not return old buffer when allocating new one

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

ASF subversion and git services commented on GEODE-6662:
--------------------------------------------------------

Commit 65ced0fb9be22acaa4378677b61a4e3e240bc72c in geode's branch refs/heads/feature/GEODE-6662 from Bruce Schuchardt
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=65ced0f ]

GEODE-6662 NioPlainEngine.ensureWrappedCapacity

Fixing a memory leak:

Return the old buffer to the Buffers pool after copying its
contents to a newly allocated buffer.


> NioPlainEngine.ensureWrappedCapacity does not return old buffer when allocating new one
> ---------------------------------------------------------------------------------------
>
>                 Key: GEODE-6662
>                 URL: https://issues.apache.org/jira/browse/GEODE-6662
>             Project: Geode
>          Issue Type: Bug
>          Components: messaging
>            Reporter: Darrel Schneider
>            Priority: Major
>
> NioPlainEngine.ensureWrappedCapacity does not return old buffer when allocating new one.
> The problem is the last block of code that calls Buffers.acquireBuffer, copies the "oldBuffer" into it, but then does not return "oldBuffer". It should have called Buffers.releaseBuffer. These direct buffers can eventually get garbage collected but the reason we have a pool of direct buffers is that the jvm can be very slow about returning the direct, native, memory they use so this could cause an out of direct memory failure. It will also cause the stats maintained by Buffers tracking how much memory is allocated to never be decremented.
> It is possible that this block of code in ensureWrappedCapacity is dead code but it is hard to tell for sure.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)