Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[MXNET-922] Fix memleak in profiler #12499

Merged
merged 2 commits into from
Sep 20, 2018

Conversation

KellenSunderland
Copy link
Contributor

@KellenSunderland KellenSunderland commented Sep 10, 2018

Description

Fix a memleak reported locally by ASAN during a normal inference test.

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

@KellenSunderland KellenSunderland changed the title WIP: Fix memleak in profiler [MXNET-922] Fix memleak in profiler Sep 10, 2018
@KellenSunderland
Copy link
Contributor Author

@mxnet-label-bot can please add [pr-awaiting-review]

@marcoabreu marcoabreu added the pr-awaiting-review PR is waiting for code review label Sep 11, 2018
@@ -455,7 +455,7 @@ class Profiler {
/*! \brief filename to output profile file */
std::string filename_ = "profile.json";
/*! \brief profile statistics consist of multiple device statistics */
DeviceStats* profile_stat;
std::unique_ptr<DeviceStats[], std::default_delete<DeviceStats[]>> profile_stat;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::default_delete<DeviceStats[]> is default and not needed explicitly, I think

@KellenSunderland
Copy link
Contributor Author

KellenSunderland commented Sep 18, 2018 via email

@marcoabreu marcoabreu added pr-awaiting-response PR is reviewed and waiting for contributor to respond and removed pr-awaiting-review PR is waiting for code review labels Sep 18, 2018
@KellenSunderland
Copy link
Contributor Author

@lebeg Indeed it wasn't needed. I must have read the docs wrong. Simplified the code and rebased.

@KellenSunderland
Copy link
Contributor Author

@marcoabreu This one should be ready to merge.

@marcoabreu marcoabreu merged commit 33876c2 into apache:master Sep 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-response PR is reviewed and waiting for contributor to respond
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants