Skip to content

Readthedocs for PyLops library - memory issue #4946

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

Closed
mrava87 opened this issue Dec 3, 2018 · 10 comments
Closed

Readthedocs for PyLops library - memory issue #4946

mrava87 opened this issue Dec 3, 2018 · 10 comments
Labels
Support Support question

Comments

@mrava87
Copy link

mrava87 commented Dec 3, 2018

Details

Hello,
I have been trying to build my documentation from this project https://github.com/Statoil/pylops in readthedocs.

I get an error about memory comsumption (build report below) but I do not seem to find more details onto at which point of the build this happens. I am aware of the fact that you limit the build to 1GB memory, if you could help me understand where the build fails I could try to simplify the example to be able to avoid reaching the limit :)

Basically the documentation uses sphinx-gallery to create various examples for each class that I implement and some of them require quite some computation to be meaningful, but we are still talking about less than 10 minutes on a normal OSX laptop.

I have sent an email to your support account and Manuel replied suggesting to open an issue.

Looking forward to hearing from you,
MR

Expected Result

Building documentation

A description of what you wanted to happen
I would like to get my documentation built succesfully

Actual Result

Command killed due to excessive memory consumption

@humitos humitos added the Support Support question label Dec 3, 2018
@mrava87
Copy link
Author

mrava87 commented Dec 3, 2018

Hi humitos,
looking forward to hearing from you, hope you can help me troubleshoot this problem :)

@stsewd
Copy link
Member

stsewd commented Dec 4, 2018

I guess you could reduce the number of images or generate the images outside rtd (I think someone did this in the past)

@mrava87
Copy link
Author

mrava87 commented Dec 4, 2018

Thanks for suggestions. Could you explain how that would help? Would it help if I have a plt.close('all')
at the start/end of each Sphinx-gallery example? I see something like this is done here https://matplotlibguide.readthedocs.io/en/latest/Matplotlib/basic.html#id1

And if I generate them outside of rtd how can I then keep the Sphinx-examples in the documentation?

@stsewd
Copy link
Member

stsewd commented Dec 4, 2018

#3468

@mrava87
Copy link
Author

mrava87 commented Dec 4, 2018

Mmh this sounds a poor man job trying to replicate what Sphinx-gallery (https://sphinx-gallery.readthedocs.io/en/latest/) does for you. This is used by many libraries like Matplotlib and sciiti-learn and they have tons of images. How do they get around?

@mrava87
Copy link
Author

mrava87 commented Dec 4, 2018

Quick update. Things work now:

  • added plt.close(‘all’), this didn’t solve the problem but the build run for longer before giving up
  • remove most heavy computational examples and build is successful.

I guess the problem is that memory really goes above limit, but I wonder if it would be possible to explain how we can access the stdout and stderr of the Sphinx-build command, otherwise it’s a bit difficult to troubleshoot :)

@mrava87
Copy link
Author

mrava87 commented Dec 4, 2018

Also I think the solution in the issue you linked should not be encouraged as it makes things way more cumbersome than they can be and just does not take advantage of a fantastic library which sphinx-gallery is :)

@stsewd
Copy link
Member

stsewd commented Dec 4, 2018

Looks like we replace the output when it's killed

https://github.com/rtfd/readthedocs.org/blob/85d9a1fb236e2c2149358b1cf462159e523e80bb/readthedocs/doc_builder/environments.py#L274-L276

I guess we could keep the original output.

@mrava87
Copy link
Author

mrava87 commented Dec 4, 2018

Up to you to decide of course but I personally think that would help a lot :)

Thanks for help!

@stsewd
Copy link
Member

stsewd commented Dec 4, 2018

I think it's a good idea, I opened #4957 to track that, closing this issue as the problem was solved.

@stsewd stsewd closed this as completed Dec 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Support question
Projects
None yet
Development

No branches or pull requests

3 participants