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
Memory usage with conda installation (on Travis) #1197
Comments
I'd have to dig into this with memory_profiler to see what is happening. The one thing that is known to sometimes use a lot of memory is the dependency resolution algorithm, but it doesn't look like you are using the tricky parts of it (there is only one Can you reproduce this on a local machine? |
Thanks Aaron! I kind of have the same behaviour on my desktop. These are the steps:
I have repeated that twice, with consistent results:
Please note that you will need:
for it to be fully reproducible on your end. Best regards, |
I'm not able to reproduce it. How does Something you could do that might help is to run memory_profiler ( |
Hi Aaron, Here is a nice explanation of how Here is the plot generated with memory_profiler on my Linux desktop: I have written a small Bash script:
and then run Just in case this is relevant, here is an interesting article on how Python manages memory: On the other hand, I have added:
to our Travis builds and the memory usage has decreased so they can now finish. Please let me know if I can try something else. Many thanks, |
I am encountering a similar problem. The following command causes 1.3GB memory use on a Ubuntu 14.04 x64 VM: conda install -c ufechner -c janharms -c mutirri freekitesim Since the system only has 2GB, conda failed to complete the installation because it does not have enough memory to fork. Failing at a FYI: conda version 3.12.0 |
I recently saw the same issue on a Linux VM where |
@asmeurer, here: $ conda install -c ufechner -c janharms -c mutirri freekitesim
Fetching package metadata: ..........
Solving package specifications: ...............................
Warning: 2 possible package resolutions (only showing differing packages):
[u'freeglut-2.8.1-py27_0.tar.bz2'],
[u'freeglut-2.8.1-0.tar.bz2'],
Package plan for installation in environment /home/builder/miniconda/envs/kitesim:
The following packages will be downloaded:
package | build
---------------------------|-----------------
boost-1.55.0 | 1 13.6 MB
freetype-2.4.10 | 0 2.0 MB
jpeg-8d | 0 699 KB
lcms-1.19 | 0 595 KB
lib3ds-1.3.0 | 1 304 KB
libsodium-0.4.5 | 0 529 KB
qt-4.8.5 | 0 32.8 MB
sdl-1.2.15 | 0 2.0 MB
cairo-1.12.18 | 0 593 KB
zeromq-4.0.5 | 0 2.6 MB
cgkit-2.0.0 | py27_1 11.5 MB
distribute-0.6.45 | py27_1 517 KB
ipython-3.1.0 | py27_0 3.4 MB
pil-1.1.7 | py27_1 587 KB
pygame-patched-1.9.1 | py27_1 2.6 MB
pyopengl-py27-3.1.0b1 | py27_0 603 KB
freeglut-2.8.1 | py27_0 534 KB
pyparsing-2.0.3 | py27_0 63 KB
pytz-2015.4 | py27_0 174 KB
pyzmq-14.6.0 | py27_0 657 KB
scipy-0.15.1 | np19py27_0 37.0 MB
scons-2.3.0 | py27_0 714 KB
shiboken-1.2.1 | py27_0 883 KB
sip-4.15.5 | py27_0 243 KB
six-1.9.0 | py27_0 17 KB
dateutil-2.4.1 | py27_0 218 KB
protobuf-linux64-2.5.0 | py27_0 177 KB
pyqt-4.10.4 | py27_0 4.4 MB
pyside-1.2.1 | py27_1 5.7 MB
matplotlib-1.4.3 | np19py27_0 44.6 MB
pandas-0.16.1 | np19py27_0 10.7 MB
pyqtgraph-0.9.10 | np19py27_0 864 KB
assimulo-2.5 | np19py27_1 4.1 MB
freekitesim-0.4 | np19py27_0 2 KB
------------------------------------------------------------
Total: 185.9 MB
The following NEW packages will be INSTALLED:
assimulo: 2.5-np19py27_1
boost: 1.55.0-1
cairo: 1.12.18-0
cgkit: 2.0.0-py27_1
dateutil: 2.4.1-py27_0
distribute: 0.6.45-py27_1
enum34: 1.0.4-py27_0
freeglut: 2.8.1-py27_0
freekitesim: 0.4-np19py27_0
freetype: 2.4.10-0
funcsigs: 0.4-py27_0
ipython: 3.1.0-py27_0
jpeg: 8d-0
lcms: 1.19-0
lib3ds: 1.3.0-1
libpng: 1.5.13-1
libsodium: 0.4.5-0
llvmlite: 0.4.0-py27_0
matplotlib: 1.4.3-np19py27_0
numba: 0.18.2-np19py27_1
numpy: 1.9.2-py27_0
pandas: 0.16.1-np19py27_0
pil: 1.1.7-py27_1
pixman: 0.26.2-0
protobuf-linux64: 2.5.0-py27_0
py2cairo: 1.10.0-py27_2
pygame-patched: 1.9.1-py27_1
pyopengl-py27: 3.1.0b1-py27_0
pyparsing: 2.0.3-py27_0
pyqt: 4.10.4-py27_0
pyqtgraph: 0.9.10-np19py27_0
pyside: 1.2.1-py27_1
python-dateutil: 2.4.2-py27_0
pytz: 2015.4-py27_0
pyzmq: 14.6.0-py27_0
qt: 4.8.5-0
scipy: 0.15.1-np19py27_0
scons: 2.3.0-py27_0
sdl: 1.2.15-0
shiboken: 1.2.1-py27_0
sip: 4.15.5-py27_0
six: 1.9.0-py27_0
zeromq: 4.0.5-0
Proceed ([y]/n)? y
Fetching packages ...
boost-1.55.0-1 100% |######################################################| Time: 0:00:03 4.56 MB/s
freetype-2.4.1 100% |######################################################| Time: 0:00:00 2.89 MB/s
jpeg-8d-0.tar. 100% |######################################################| Time: 0:00:00 1.95 MB/s
lcms-1.19-0.ta 100% |######################################################| Time: 0:00:00 1.68 MB/s
lib3ds-1.3.0-1 100% |######################################################| Time: 0:00:00 1.26 MB/s
libsodium-0.4. 100% |######################################################| Time: 0:00:00 1.66 MB/s
qt-4.8.5-0.tar 100% |######################################################| Time: 0:00:10 3.21 MB/s
sdl-1.2.15-0.t 100% |######################################################| Time: 0:00:00 3.78 MB/s
cairo-1.12.18- 100% |######################################################| Time: 0:00:00 1.65 MB/s
zeromq-4.0.5-0 100% |######################################################| Time: 0:00:00 3.15 MB/s
cgkit-2.0.0-py 100% |######################################################| Time: 0:00:02 4.07 MB/s
distribute-0.6 100% |######################################################| Time: 0:00:17 30.44 kB/s
ipython-3.1.0- 100% |######################################################| Time: 0:00:01 2.79 MB/s
pil-1.1.7-py27 100% |######################################################| Time: 0:00:00 1.53 MB/s
pygame-patched 100% |######################################################| Time: 0:00:00 3.35 MB/s
pyopengl-py27- 100% |######################################################| Time: 0:00:00 1.61 MB/s
freeglut-2.8.1 100% |######################################################| Time: 0:00:00 1.52 MB/s
pyparsing-2.0. 100% |######################################################| Time: 0:00:00 528.28 kB/s
pytz-2015.4-py 100% |######################################################| Time: 0:00:04 41.64 kB/s
pyzmq-14.6.0-p 100% |######################################################| Time: 0:00:00 1.55 MB/s
scipy-0.15.1-n 100% |######################################################| Time: 0:00:10 3.75 MB/s
scons-2.3.0-py 100% |######################################################| Time: 0:00:00 966.36 kB/s
shiboken-1.2.1 100% |######################################################| Time: 0:00:00 1.83 MB/s
sip-4.15.5-py2 100% |######################################################| Time: 0:00:00 876.04 kB/s
six-1.9.0-py27 100% |######################################################| Time: 0:00:00 391.91 kB/s
dateutil-2.4.1 100% |######################################################| Time: 0:00:00 750.81 kB/s
protobuf-linux 100% |######################################################| Time: 0:00:00 1.02 MB/s
pyqt-4.10.4-py 100% |######################################################| Time: 0:00:03 1.21 MB/s
pyside-1.2.1-p 100% |######################################################| Time: 0:00:02 2.67 MB/s
matplotlib-1.4 100% |######################################################| Time: 0:00:13 3.51 MB/s
pandas-0.16.1- 100% |######################################################| Time: 0:00:03 3.13 MB/s
pyqtgraph-0.9. 100% |######################################################| Time: 0:00:00 973.30 kB/s
assimulo-2.5-n 100% |######################################################| Time: 0:00:01 3.01 MB/s
freekitesim-0. 100% |######################################################| Time: 0:00:00 1.79 MB/s
Extracting packages ...
[ COMPLETE ]|#########################################################################| 100%
Linking packages ...
An unexpected error has occurred, please consider sending the | 0%
following traceback to the conda GitHub issue tracker at:
https://github.com/conda/conda/issues
Include the output of the command 'conda info' in your report.
Traceback (most recent call last):
File "/home/builder/miniconda/envs/kitesim/bin/conda", line 5, in <module>
sys.exit(main())
File "/home/builder/miniconda/lib/python2.7/site-packages/conda/cli/main.py", line 203, in main
args_func(args, p)
File "/home/builder/miniconda/lib/python2.7/site-packages/conda/cli/main.py", line 208, in args_func
args.func(args, p)
File "/home/builder/miniconda/lib/python2.7/site-packages/conda/cli/common.py", line 609, in inner
return func(args, parser)
File "/home/builder/miniconda/lib/python2.7/site-packages/conda/cli/main_install.py", line 46, in execute
install.install(args, parser, 'install')
File "/home/builder/miniconda/lib/python2.7/site-packages/conda/cli/install.py", line 413, in install
plan.execute_actions(actions, index, verbose=not args.quiet)
File "/home/builder/miniconda/lib/python2.7/site-packages/conda/plan.py", line 531, in execute_actions
inst.execute_instructions(plan, index, verbose)
File "/home/builder/miniconda/lib/python2.7/site-packages/conda/instructions.py", line 156, in execute_instructions
cmd(state, arg)
File "/home/builder/miniconda/lib/python2.7/site-packages/conda/instructions.py", line 93, in LINK_CMD
link(state['prefix'], arg, index=state['index'])
File "/home/builder/miniconda/lib/python2.7/site-packages/conda/instructions.py", line 89, in link
install.link(pkgs_dir, prefix, dist, lt, index=index)
File "/home/builder/miniconda/lib/python2.7/site-packages/conda/install.py", line 568, in link
if not run_script(prefix, dist, 'post-link'):
File "/home/builder/miniconda/lib/python2.7/site-packages/conda/install.py", line 350, in run_script
subprocess.check_call(args, env=env)
File "/home/builder/miniconda/lib/python2.7/subprocess.py", line 535, in check_call
retcode = call(*popenargs, **kwargs)
File "/home/builder/miniconda/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "/home/builder/miniconda/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/home/builder/miniconda/lib/python2.7/subprocess.py", line 1231, in _execute_child
self.pid = os.fork()
OSError: [Errno 12] Cannot allocate memory |
Ah, some package has a post-link script. That explains why os.fork is used. |
The code import logging
logging.disable(logging.NOTSET)
logging.basicConfig(level=logging.DEBUG)
from conda.cli.install import check_install
check_install(['freekitesim'], platform='linux-64', channel_urls=('ufechner', 'janharms', 'mutirri', 'defaults'), prepend=False) will reproduce this on any machine (not just Linux). If I run that on OS X I get very low memory usage (no more than 600 MB), and the memory usage drops a few times when things are garbage collected. I can maybe see it getting that big if nothing was ever garbage collected. Maybe using memory profiler to produce a memory graph from that script on Ubuntu and on OS X and comparing them would give some insight. |
Thanks for the tip about Instruments @sklam. The issue was a @sebastian-luna-valero I noticed you are also using Python 2. Can you report back if this doesn't fix it after we release (or alternately, if Miniconda3 fixes your problems)? |
Thanks @asmeurer I have just re-run the script above:
This is the output:
and this is the result: Any other suggestions? Many thanks, |
@sebastian-luna-valero I guess your issue was something else. |
Hi there, thank you for your contribution to Conda! This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs. If you would like this issue to remain open please:
NOTE: If this issue was closed prematurely, please leave a comment and we will gladly reopen the issue. In case this issue was originally about a project that is covered by the Anaconda issue tracker (e.g. Anaconda, Miniconda, packages built by Anaconda, Inc. like Anaconda Navigator etc), please reopen the issue there again. Thanks! |
Hi again! This issue has been closed since it has not had recent activity. Thank you for your contribution. |
Dear all,
We are using Travis for continuous integration. Our code base depends on a number of Python and R/Bioconductor packages that I am installing with Conda.
As you may know, Travis builds for open-source projects come with resource restrictions:
http://docs.travis-ci.com/user/ci-environment/#The-Build-Machine
namely, 3GB RAM + 1.5GB swap with 2 cores.
My problem here is with RAM usage. Our Travis builds fail due to the target system running out of memory and after some troubleshooting I have realised that the command:
consumes most of the RAM but in a non-deterministic fashion.
In a failed Travis build the amount of RAM, as reported by
free
, goes from 1.2GB to 4.5GB (maximum allowed by Travis). Please see beforeconda create
:https://travis-ci.org/CGATOxford/cgat/jobs/54262464#L124
and after:
https://travis-ci.org/CGATOxford/cgat/jobs/54262464#L571
This is the error reported by Travis:
https://travis-ci.org/CGATOxford/cgat/jobs/54262464#L682
In a successful Travis build the amount of RAM goes from 1.2GB to 1.8GB. Please see before
conda create
:https://travis-ci.org/CGATOxford/cgat/jobs/54262465#L124
and after:
https://travis-ci.org/CGATOxford/cgat/jobs/54262465#L571
I have also found this thread:
travis-ci/travis-ci#2904
kindly asking for higher amount of resources for Travis builds but that is not going to happen soon.
I have used
conda clean --index-cache
with no success. I was wondering whether you could provide advice on this or do you think I need to ask to Travis forum instead?PS: My Conda recipes for R/Bioconductor packages are not uploaded to Git Hub yet but I am willing to do so soon, just in case anyone is interested in having them.
The text was updated successfully, but these errors were encountered: