fast-aircraft-design / FAST-OAD

FAST-OAD: An open source framework for rapid Overall Aircraft Design
GNU General Public License v3.0
47 stars 25 forks source link

Memory fix #443

Closed christophe-david closed 2 years ago

christophe-david commented 2 years ago

OpenMDAO objects were persisting in RAM after setup or run operations. This could be a problem when running multiple computations in the same Python session: memory consumption was continuously raising, and computation time was increasing.

This was due to iPOPO instantiating OpenMDAO components, but never releasing them, since we did not ask to.

This PR solves this problem in a somehow rough way, but it apparently works fine.

codecov[bot] commented 2 years ago

Codecov Report

Merging #443 (cfcb69f) into master (a9e8826) will increase coverage by 0.02%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #443      +/-   ##
==========================================
+ Coverage   89.47%   89.49%   +0.02%     
==========================================
  Files          73       73              
  Lines        4416     4427      +11     
  Branches      709      711       +2     
==========================================
+ Hits         3951     3962      +11     
  Misses        337      337              
  Partials      128      128              
Impacted Files Coverage Δ
src/fastoad/module_management/_bundle_loader.py 96.95% <100.00%> (+0.13%) :arrow_up:
src/fastoad/openmdao/problem.py 94.00% <100.00%> (+0.16%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a9e8826...cfcb69f. Read the comment docs.

christophe-david commented 2 years ago

Also, it seems that the new memory test is not integrated in the CI yet.

Done in cfcb69f805ff52fa3b01448f31b9a4b945c2c0a0