Skip to content

Comments

Fix probability framework allocations (Issue #2036)#2041

Closed
bbbales2 wants to merge 2 commits intodevelopfrom
bugfix/issue-2036
Closed

Fix probability framework allocations (Issue #2036)#2041
bbbales2 wants to merge 2 commits intodevelopfrom
bugfix/issue-2036

Conversation

@bbbales2
Copy link
Member

Fixes #2036

Release notes

Fixes some memory allocation problems with test framework

Checklist

  • Math issue Probability test framework doesn't clean up memory properly #2036

  • Copyright holder: (fill in copyright holder information)

    The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
    - Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
    - Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

  • the basic tests are passing

    • unit tests pass (to run, use: ./runTests.py test/unit)
    • header checks pass, (make test-headers)
    • dependencies checks pass, (make test-math-dependencies)
    • docs build, (make doxygen)
    • code passes the built in C++ standards checks (make cpplint)
  • the code is written in idiomatic C++ and changes are documented in the doxygen

  • the new changes are tested

@SteveBronder
Copy link
Collaborator

Quick Q, could we just make a TearDown() function in the test suite that calls recover_memory() like

  void TearDown() {
    stan::math::recover_memory();
  }

@bbbales2
Copy link
Member Author

I think it makes sense to do the recover memories where they are now. For instance, there are new vars allocated each iteration of the loop here and we recover the memory each time:

stan::math::recover_memory();

@SteveBronder
Copy link
Collaborator

cool cool ping me when this is passing and I'll look it over

@bbbales2
Copy link
Member Author

bbbales2 commented Sep 3, 2020

I'm just gonna put these changes in #2042 since there are problems here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Probability test framework doesn't clean up memory properly

3 participants