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/10/17 18:48:00 UTC
[jira] [Commented] (GEODE-7299) Memory leak in
PdxInstanceImpl::updatePdxStream
[ https://issues.apache.org/jira/browse/GEODE-7299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16954018#comment-16954018 ]
ASF subversion and git services commented on GEODE-7299:
--------------------------------------------------------
Commit bb40163f5eb900b0ca18512d619e17ca88d13c65 in geode-native's branch refs/heads/develop from Blake Bender
[ https://gitbox.apache.org/repos/asf?p=geode-native.git;h=bb40163 ]
GEODE-7299: Fix PdxInstanceImpl memory leak (#537)
* GEODE-7299: Fix memory leak in PdxInstanceImpl::updatePdxStream
- include a unit test which will show the leak when run under leak-checking app, e.g. Valgrind
- m_buffer member variable changed to a std::vector
- m_bufferLength member variable no longer needed, removed
Co-authored-by: Mike Martell <mm...@pivotal.io>
> Memory leak in PdxInstanceImpl::updatePdxStream
> -----------------------------------------------
>
> Key: GEODE-7299
> URL: https://issues.apache.org/jira/browse/GEODE-7299
> Project: Geode
> Issue Type: Bug
> Components: native client
> Reporter: Blake Bender
> Priority: Major
> Time Spent: 1h
> Remaining Estimate: 0h
>
> The `PdxInstanceImpl::updatePdxStream` method assigns the result of `DataInput::getBufferCopy` to its `m_buffer` member variable, but `m_buffer` is deleted by `PdxInstanceImpl` in its destructor, implying that `PdxInstanceImpl` owns the pointer, which means, in this case, that the existing `m_buffer`, if there is one, is leaked in this call. We discovered that `updatePdxStream` is called on every put of a Pdx type, so in a tight loop with a lot of puts we are potentially leaking _a lot_ of memory.
>
> Repro steps:
> Run the soon-to-be-implemented `LeakPdxMemory` test in the NC integration test suite. Test will attempt to do a large number of puts of a large Pdx object, and look for an out of memory exception.
>
> Expected result:
> Test passes
>
> Actual result:
> Test fails.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)