Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test suite consumes an extraordinary amount of memory #104

Open
tillea opened this issue Dec 21, 2018 · 4 comments
Open

Test suite consumes an extraordinary amount of memory #104

tillea opened this issue Dec 21, 2018 · 4 comments

Comments

@tillea
Copy link
Contributor

tillea commented Dec 21, 2018

Hi,
there is a bug report for the Debian packaged version which says that the ruffus test suite consumes an extraordinary amount of memory on the build machine. The bug was filed in 2016 for version 2.6.3 of ruffus where a memory consumption of 18GB was measured. The bug reporter did a new measure for the recent version 2.8.1 he gets 38GB so it became worse. I tried to reproduce the issue and can confirm that if I do

while true; do grep Committed_AS /proc/meminfo; sleep 1; done

in a separate xterm while running the build time tests I get something like

Committed_AS:    9807008 kB
Committed_AS:   22324324 kB
Committed_AS:   33082052 kB
Committed_AS:   33082052 kB
Committed_AS:   17073508 kB
Committed_AS:   41512736 kB
Committed_AS:   45553976 kB
Committed_AS:   26653296 kB
Committed_AS:    5887392 kB

while the test suite outputs something like

test_pool_manager.py::TestExecutionEngines::test_pipeline_fails_with_unknown_manager PASSED [ 25%]
test_pool_manager.py::TestExecutionEngines::test_pipeline_runs_with_gevent_manager <- ../../../../../../../usr/lib/python2.7/unittest/case.py SKIPPED [ 50%]
test_pool_manager.py::TestExecutionEngines::test_pipeline_runs_with_multiprocessing PASSED [ 75%]
test_pool_manager.py::TestExecutionEngines::test_pipeline_runs_with_multithreading PASSED [100%]

===================== 3 passed, 1 skipped in 2.50 seconds ======================
pytest -v test_cmdline.py
============================= test session starts ==============================
platform linux2 -- Python 2.7.15+, pytest-3.6.4, py-1.7.0, pluggy-0.8.0 -- /usr/bin/python2
cachedir: ../../../../../.pytest_cache
rootdir: /home/andreas/debian-maintain/salsa/med-team/build-area/python-ruffus-2.8.1, inifile:
collecting ... collected 4 items

test_cmdline.py::Test_cmdline::test_argparse PASSED                      [ 25%]
test_cmdline.py::Test_cmdline::test_optparse PASSED                      [ 50%]
test_cmdline.py::Test_cmdline::test_verbose PASSED                       [ 75%]
test_cmdline.py::Test_cmdline::test_verbose_abbreviated_path PASSED      [100%]

Please note: I'm definitely not sure that this is the affected test neither that these are the only tests which push the memory limit way more far than other programs but I confirm that the reporter is right and that the issue can be found somewhere close here. I'd suggest some bisecting to find the actual test to find out the reason.
Kind regards, Andreas.

@AndreasHeger
Copy link
Collaborator

AndreasHeger commented Dec 21, 2018 via email

@eamanu
Copy link

eamanu commented Mar 22, 2021

Hi @AndreasHeger,

Are there some advances for this issue?

Thanks!

@emollier
Copy link

emollier commented Dec 6, 2021

Greetings,

I kept a close look to the committed memory while running the test suite and I believe I identified a 20GB bump in the memory consumption in ruffus/test/test_with_logger.py. The test runs the pipeline at 500 processes on two occurrences, which seemed a bit unreasonable on low cores count machines, possibly having little memory as well. When I adjusted the process count of the test suite to my PC cores count, the memory consumption delta dropped to 5GB.

Would it be possible to dynamically adjust the multiprocess in the pipeline_run calls of the test suite to the machines allowed cores count (e.g. with len(os.sched_getaffinity(0))), or would it go against the purpose of the test?

Have a nice day, :)
Étienne.

@emollier
Copy link

emollier commented Dec 6, 2021

The change I had in mind is available under the form of patch at the following location in case you are interested:

https://salsa.debian.org/med-team/python-ruffus/-/blob/debian/2.8.4-4/debian/patches/reasonable-multiprocessing.patch

Please feel free to use it if you think this is useful.

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

No branches or pull requests

4 participants