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

Make it possible to import packages on container with lower than 2 GB of memory #46912

Closed
schlichtanders opened this issue Sep 26, 2022 · 10 comments

Comments

@schlichtanders
Copy link

This is actually a really crucial problem I am facing currently. I already pushed it at the specific package which I was not able to import, SciMLSensitivity, but @ChrisRackauckas mentioned this is rather a generic Julia issue.

What happens? julia is killed as soon as I merely import a package...
image

This happens, because the docker container is restricted to 2 GB of RAM, while loading this package needs more than 2 GB of RAM (or at least in this default setup without any additional configuration it needs more).

Hence I am unable to use binder for SciML, and also anyone else is unable to use mybinder for SciML. A real pity.
It would be great if loading a package does not kill a moderate machine like a binder instance with 2 GB of RAM.

@gbaraldi
Copy link
Member

1.8.2 might make this a bit better because it makes julia more aware of memory constraints. It should release in a couple days if no issues are found

@PallHaraldsson
Copy link
Contributor

PallHaraldsson commented Sep 26, 2022

New in 1.9, can you try something like:

julia --heap-size-hint=2G

I think compilation of packages makes new julia processes, then they have their own memory and GC, and the limitation is likely not inherited (but should it?). You can also try limiting parallel compilation. Maybe just disable it with:

ENV["JULIA_NUM_PRECOMPILE_TASKS"] = 1

@maleadt
Copy link
Member

maleadt commented Sep 26, 2022

This is essentially a dup of #24617.

New in 1.9, can you try something like:

julia --heap-size-hint=2G

No need for that, it will be auto-detected. Only use --heap-size if you want (or need) to restrict further.

@schlichtanders
Copy link
Author

It would also be great to have a way to change julia's import behaviour from within the running julia kernel

@schlichtanders
Copy link
Author

sorry, wrong button

@PallHaraldsson
Copy link
Contributor

PallHaraldsson commented Sep 27, 2022

What do you mean "import behavior" (and Julia kernel, if Jypyter, then an issue on the needs to be opened elsewhere).

I think you might be able to do:

ENV["JULIA_NUM_PRECOMPILE_TASKS"] = 1

from within Jupyter (and Pluto etc.), might not be too late, or start it that way from the shell, similar to you would do for Julia (at least on Linux):

$ JULIA_NUM_PRECOMPILE_TASKS = 1 julia

@PallHaraldsson
Copy link
Contributor

PallHaraldsson commented Sep 27, 2022

This might be fixed already with: #46796

I would check with master/nightly at the download page. It looks like it made it into 1.8.2 which should appear soon (it was merged recently). If I misread, then 1.8.3 seems coming too (but I see no proof of an open backport PR for it yet): #46796 (comment)

When #46844 lands it's also likely to help (with memory use). See also: #46831

@maleadt
Copy link
Member

maleadt commented Sep 29, 2022

1.8.2 is imminent, and should fix this.

@maleadt maleadt closed this as completed Sep 29, 2022
@schlichtanders
Copy link
Author

schlichtanders commented Oct 9, 2022

This is unfortunately not fixed in julia 1.8.2

the kernel still dies when importing
image

EDIT: here the plain terminal test on mybinder with 2GB memory:
image

@maleadt
Copy link
Member

maleadt commented Oct 9, 2022

What distro are you trying this on? Does it use cgroupv1 or v2? #46796 (comment) may be relevant.

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