You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apex.apache.org by gauravgopi123 <gi...@git.apache.org> on 2016/01/12 02:41:28 UTC

[GitHub] incubator-apex-core pull request: APEXCORE-296 #comment fixed the ...

GitHub user gauravgopi123 opened a pull request:

    https://github.com/apache/incubator-apex-core/pull/203

    APEXCORE-296 #comment fixed the memory leak

    

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

    $ git pull https://github.com/gauravgopi123/incubator-apex-core APEXCORE-296

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

    https://github.com/apache/incubator-apex-core/pull/203.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 #203
    
----
commit 758193c2589b9b948fe4e560d14fc40c8e380560
Author: Gaurav <ga...@datatorrent.com>
Date:   2016-01-12T01:21:53Z

    APEXCORE-296 #comment fixed the memory leak

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-apex-core pull request: APEXCORE-296 #comment fixed the ...

Posted by gauravgopi123 <gi...@git.apache.org>.
Github user gauravgopi123 commented on the pull request:

    https://github.com/apache/incubator-apex-core/pull/203#issuecomment-172027003
  
    @tweise : Incorporated feedback


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-apex-core pull request: APEXCORE-296 #comment fixed the ...

Posted by amberarrow <gi...@git.apache.org>.
Github user amberarrow commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-core/pull/203#discussion_r49877090
  
    --- Diff: engine/src/main/java/com/datatorrent/stram/StreamingContainerManager.java ---
    @@ -1027,6 +1027,19 @@ public int processEvents()
             }
           }
           o.stats.lastWindowedStats = stats;
    +      if (!o.stats.responses.isEmpty()) {
    +        if (o.stats.operatorResponses == null) {
    +          o.stats.operatorResponses = new ArrayList<>();
    +        } else {
    +          o.stats.operatorResponses.clear();
    +        }
    +        StatsListener.OperatorResponse operatorResponse;
    +        while ((operatorResponse = o.stats.responses.poll()) != null) {
    +          o.stats.operatorResponses.add(operatorResponse);
    +        }
    +      } else {
    +        o.stats.operatorResponses = null;
    --- End diff --
    
    This version tries to avoid creating garbage by reusing the ArrayList if one is already present.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-apex-core pull request: APEXCORE-296 #comment fixed the ...

Posted by tweise <gi...@git.apache.org>.
Github user tweise commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-core/pull/203#discussion_r49879967
  
    --- Diff: engine/src/main/java/com/datatorrent/stram/StreamingContainerManager.java ---
    @@ -1027,6 +1027,19 @@ public int processEvents()
             }
           }
           o.stats.lastWindowedStats = stats;
    +      if (!o.stats.responses.isEmpty()) {
    +        if (o.stats.operatorResponses == null) {
    +          o.stats.operatorResponses = new ArrayList<>();
    +        } else {
    +          o.stats.operatorResponses.clear();
    +        }
    +        StatsListener.OperatorResponse operatorResponse;
    +        while ((operatorResponse = o.stats.responses.poll()) != null) {
    +          o.stats.operatorResponses.add(operatorResponse);
    +        }
    +      } else {
    +        o.stats.operatorResponses = null;
    --- End diff --
    
    That's what I thought the intention was, but in this case benefits are negligible. Why do we set it to null in the else block? To avoid more if then else clutter? ;-)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-apex-core pull request: APEXCORE-296 #comment fixed the ...

Posted by gauravgopi123 <gi...@git.apache.org>.
Github user gauravgopi123 commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-core/pull/203#discussion_r49877877
  
    --- Diff: engine/src/main/java/com/datatorrent/stram/StreamingContainerManager.java ---
    @@ -1027,6 +1027,19 @@ public int processEvents()
             }
           }
           o.stats.lastWindowedStats = stats;
    +      if (!o.stats.responses.isEmpty()) {
    +        if (o.stats.operatorResponses == null) {
    +          o.stats.operatorResponses = new ArrayList<>();
    +        } else {
    +          o.stats.operatorResponses.clear();
    +        }
    +        StatsListener.OperatorResponse operatorResponse;
    +        while ((operatorResponse = o.stats.responses.poll()) != null) {
    +          o.stats.operatorResponses.add(operatorResponse);
    +        }
    +      } else {
    +        o.stats.operatorResponses = null;
    --- End diff --
    
    @tweise : Initially it was done that way but @amberarrow suggested that we reuse the same list if possible, so made this change. I am fine with either way...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-apex-core pull request: APEXCORE-296 #comment fixed the ...

Posted by gauravgopi123 <gi...@git.apache.org>.
Github user gauravgopi123 commented on the pull request:

    https://github.com/apache/incubator-apex-core/pull/203#issuecomment-170754958
  
    @tweise : Please review it


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-apex-core pull request: APEXCORE-296 #comment fixed the ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-apex-core/pull/203


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-apex-core pull request: APEXCORE-296 #comment fixed the ...

Posted by tweise <gi...@git.apache.org>.
Github user tweise commented on a diff in the pull request:

    https://github.com/apache/incubator-apex-core/pull/203#discussion_r49829019
  
    --- Diff: engine/src/main/java/com/datatorrent/stram/StreamingContainerManager.java ---
    @@ -1027,6 +1027,19 @@ public int processEvents()
             }
           }
           o.stats.lastWindowedStats = stats;
    +      if (!o.stats.responses.isEmpty()) {
    +        if (o.stats.operatorResponses == null) {
    +          o.stats.operatorResponses = new ArrayList<>();
    +        } else {
    +          o.stats.operatorResponses.clear();
    +        }
    +        StatsListener.OperatorResponse operatorResponse;
    +        while ((operatorResponse = o.stats.responses.poll()) != null) {
    +          o.stats.operatorResponses.add(operatorResponse);
    +        }
    +      } else {
    +        o.stats.operatorResponses = null;
    --- End diff --
    
    The else block isn't needed?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---