[
https://issues.apache.org/jira/browse/TRAFODION-2326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15635530#comment-15635530
]
ASF GitHub Bot commented on TRAFODION-2326:
-------------------------------------------
Github user prashanth-vasudev commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/815#discussion_r86497791
--- Diff: core/sql/executor/ex_sort.cpp ---
@@ -330,21 +364,39 @@ ExSortTcb::~ExSortTcb()
nfDiags_ = NULL;
freeResources();
-
- if(pool_)
- delete pool_;
+
};
////////////////////////////////////////////////////////////////////////
// Free Resources
//
void ExSortTcb::freeResources()
{
- if (sortPool_)
+ if (partialSortPool_)
+ {
+ delete partialSortPool_;
+ partialSortPool_ = NULL;
+ }
+ if (regularSortPool_)
+ {
+ delete regularSortPool_;
+ regularSortPool_ = NULL;
+ }
+ if (topNSortPool_)
+ {
+ delete topNSortPool_;
+ topNSortPool_ = NULL;
+ }
+ if (sortPool_ && (sortPool_ != receivePool_))
--- End diff --
I will make this change. The thinking was to delete the memory once, either
by sortPool_ or receivePool_. setting them to null seems to be a no op since
it is called only in the destructor.
> TopN sort consumes more memory than needed.
> -------------------------------------------
>
> Key: TRAFODION-2326
> URL: https://issues.apache.org/jira/browse/TRAFODION-2326
> Project: Apache Trafodion
> Issue Type: Bug
> Components: sql-exe
> Affects Versions: 2.1-incubating
> Reporter: Prashanth Vasudev
> Assignee: Prashanth Vasudev
>
> Records that get discarded , those that do not belong to TopN rows, release
> reference to the tupp descriptor, however the released tuple memory does not
> get reused for new records from child nodes.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)