You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/10/07 22:26:21 UTC

[jira] [Commented] (TRAFODION-2266) Fix a few memory leaks

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

ASF GitHub Bot commented on TRAFODION-2266:
-------------------------------------------

GitHub user sureshsubbiah opened a pull request:

    https://github.com/apache/incubator-trafodion/pull/748

    [TRAFODION-2266] Fix for a few memory leaks

    Constructor for NACollection derived class now require an explicit heap.
    This helps catch a few leaks. It also allows for better accounting of 
    how memory is being used using the standard NAMemory infrastructure.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/sureshsubbiah/incubator-trafodion memleak1

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-trafodion/pull/748.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #748
    
----
commit eb3986eb0bc1f8cb48cb2bf3a9d15c7fcd5aa356
Author: Suresh Subbiah <su...@apache.org>
Date:   2016-10-05T04:11:52Z

    Create NACollection objects on NAHeap.
    Avoid use of system heap as far as possible

commit a143ba9b99588e0aa328959abb02512b6adf37a2
Author: Suresh Subbiah <su...@apache.org>
Date:   2016-10-05T04:17:39Z

    Merge remote branch 'origin/master' into memleak1
    
    Conflicts:
    	core/sql/optimizer/NormRelExpr.cpp

commit c164c5b0ed396cc1764c695846507c7edeb08cba
Author: Suresh Subbiah <su...@apache.org>
Date:   2016-10-07T22:22:25Z

    Post merge commit. All files here relate to NAList

----


> Fix a few memory leaks 
> -----------------------
>
>                 Key: TRAFODION-2266
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2266
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-general
>    Affects Versions: any
>            Reporter: Suresh Subbiah
>            Assignee: Suresh Subbiah
>             Fix For: 2.1-incubating
>
>
> In the sql component of Trafodion memory for most objects derive from NABasicObject. The new/delete operators they use are overloaded to use memory managed by the NAHeap objects. This allows for memory to managed according to the component that is using it. It also make it somewhat easier to identify the source of a leak as various NAHeaps are used by different parts of the code. Collection objects such as Set, List, Array are derived from NACollection template base class. An NACollection object can be allocated on an NAHeap, and the memory it uses to allocate its storage as new objects are inserted can come for an NAHeap that is passed in during construction. However if no heap is passed in objects will be created in the global/system heap. This can lead to a leak since many parts of the code rely on something like StatementHeap (an NAHeap) to be deallocated as a whole it is no longer needed. 
> This change removes constructors for derived classes on NACollection, what have no NAHeap argument. In other words from now on whenever an NaCollection derived object is created, the developer must explicitly specify the heap. If it should be system heap (no NAHeap is available/suitable), then NULL can be passed in (once NABasicObject.h is included). This is based on suggestions by Selva and Hans. Removing these constructors caused code to not compile. All compile failures have been fixed by making all calls to these constructors specify an explicit heap. Use of NULL for this explicit heap has been minimized to a large extent.



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