How to pass command-line arguments to Jupyter Notebook?

How do I pass command line arguments when I run Julia using Jupyter notebook?

When I use VS Code to run Julia, I can go to settings and set "julia.additionalArgs": [ "--heap-size-hint=1G" ], what about Jupyter notebook? I use Windows and normally I just go to Menu and click Jupyter Notebook, then it automatically opens in a web browser.

Alternatively, are there ways to set --heap-size-hint=1G in Jupyter notebook? I’m encountering memory issues when running Julia v1.9.1 and based on what I have found in recent posts setting --heap-size-hint is a quick fix (at least for the codes I’m running).

You could run Jupyter notebooks directly in VS Code, using Jupyter - Visual Studio Marketplace. That way it uses the VS Code configuration for Julia.

Otherwise, if you use IJulia, then you create a new kernel with your preferred options, see Installation · IJulia (julialang.github.io) and Making kernels for Jupyter — jupyter_client 8.2.0 documentation (jupyter-client.readthedocs.io).


(Independent, it sounds a bit strange that the option is needed.)