Stream: helpdesk (published)

Topic: VSCode and memory usage


view this post on Zulip Júlio Hoffimann (Feb 15 2024 at 13:15):

Is there a feature in VSCode to plot the memory used by each variable in a Julia session? Something like an interactive pie chart:

image.png

view this post on Zulip Kyle Beggs (Feb 15 2024 at 13:18):

https://github.com/JuliaCI/Coverage.jl?tab=readme-ov-file#memory-allocation

view this post on Zulip Kyle Beggs (Feb 15 2024 at 13:19):

It doesn't plot like a pie chart, but there are tools you can use to plot a flamegraph

view this post on Zulip Júlio Hoffimann (Feb 15 2024 at 13:19):

Thanks @Kyle Beggs , I used this --track-allocation option in the past, but it is not exactly what I am looking for. The option you mentioned only saves files to disk where Julia allocated memory line by line in the scripts.

view this post on Zulip Júlio Hoffimann (Feb 15 2024 at 13:20):

I am looking for memory usage in a session at any given time. I have variables loaded in a session, and would like to see which variables are consuming most of the memory, makes sense?

view this post on Zulip Kyle Beggs (Feb 15 2024 at 13:21):

Ah, I see. I agree this would be useful, don't know how to go about that. Sorry

view this post on Zulip Júlio Hoffimann (Feb 15 2024 at 13:21):

VSCode already has a Julia pane with all the variables in the session, but it doesn't show any memory size information.

view this post on Zulip Júlio Hoffimann (Feb 15 2024 at 13:22):

image.png

view this post on Zulip Kyle Beggs (Feb 15 2024 at 13:24):

Seems like you really just need to iterate through that list and call summarysize then you can sort and plot. The guys that develop the VSCode Julia extension would probably be able to do this somewhat easily

view this post on Zulip Timothy (Feb 15 2024 at 13:24):

summarysize can sometimes take several minutes on large objects, I'll note

view this post on Zulip Júlio Hoffimann (Feb 15 2024 at 13:27):

That would be a super useful feature, specially if we can have an interactive pie chart that can zoom in the fields of structs in a tree-like structure.

view this post on Zulip Júlio Hoffimann (Feb 15 2024 at 13:27):

I did the Base.summarysize for all objects in the session and they sum up to 9Gb, but htop is saying that Julia is consuming 16Gb

view this post on Zulip Júlio Hoffimann (Feb 15 2024 at 13:28):

The runtime is basically doubling the memory usage of the session

view this post on Zulip Brian Chen (Feb 15 2024 at 14:48):

Have you looked into heap snapshots and the various tools that can view them? https://discourse.julialang.org/t/plans-for-viewing-heap-snapshots/98696/2

view this post on Zulip Júlio Hoffimann (Feb 15 2024 at 14:53):

Brian Chen said:

Have you looked into heap snapshots and the various tools that can view them? https://discourse.julialang.org/t/plans-for-viewing-heap-snapshots/98696/2

First time I hear about it. Any visual feature in VSCode to inspect memory would be great.

view this post on Zulip jar (Feb 15 2024 at 19:39):

https://github.com/JuliaLang/julia/issues/52680


Last updated: Nov 22 2024 at 04:41 UTC