Constant out of memory error of VSCode extension

So I use VSCode to login in to the supercomputer I’m working with, and I installed the Julia extension on it. It works well, but recently I noticed that the following error appears frequently:

[ Info: Loading GPUArraysCore from cache... (50%)
[ Info: Loading Adapt from cache... (50%)
[ Info: Loading Measures from cache... (50%)
[ Info: Loading FFMPEG from cache... (50%)
[ Info: Loading BinaryProvider from cache... (50%)
[ Info: Loading PlotThemes from cache... (50%)
[ Info: Loading Contour from cache... (50%)
[ Info: Loading LaTeXStrings from cache... (75%)
[ Info: Received new data from Julia Symbol Server.
Internal error: encountered unexpected error in runtime:
OutOfMemoryError()
jl_gc_alloc_new_page at /home1/***/julia/src/gc-pages.c:163 [inlined]
jl_gc_alloc_page at /home1/***/julia/src/gc-pages.c:222
add_page at /home1/***/julia/src/gc.c:1422

As you can see, this usually happens when the language server loads all packages installed. After the error the language server closes and restarts.

I don’t really have lots of packages installed actually: below is a list of installed packages:

Status `~/.julia/environments/v1.9/Project.toml`
  [f67ccb44] HDF5 v0.16.15
  [b964fa9f] LaTeXStrings v1.3.0
⌃ [8314cec4] PGFPlotsX v1.5.1
⌃ [91a5bcdd] Plots v1.15.2

What’s the root cause of this? It’s hard to imagine that indexing so few packages can cause a memory problem. Is there any way to solve this?

how much memory do you actually have?

One login node has 192GB RAM in total but that’s shared by users. Also,

julia> Sys.total_memory() / 2^20
191724.78515625

julia> Sys.free_memory() / 2^20
169993.390625

I guess that’s the total memory allocated to one user?

I suppose it’s possible system admin sets some kind of cap that’s smaller than

1 Like

Did you try to launch Julia with the parameter:

 --heap-size-hint=<size>    Forces garbage collection if memory usage is higher than that value.
                            The memory hint might be specified in megabytes(500M) or gigabytes(1G)

1 Like

Thanks for the suggestion - can you tell me how to configure this for the Julia language server used in the VSCode extension?

That is not straightforward. You could try to confiigure julia.executablePath and put a script in that directory that calls julia with the correct parameters…

And create an issue in vscode: GitHub - julia-vscode/julia-vscode: Julia extension for Visual Studio Code

1 Like

Do you have any large files in your current workspace? E.g. files generated by MTK.jl or something?

Yes - plenty of them. I use Julia together with QuantumESPRESSO and BerkeleyGW, so there are always lots of large (~100G) wave function files.