Sometimes when I run a Julia script in the terminal, e.g. julia my_script.jl the program will exit with a simple Killed message, e.g:
Presumably, this is because I ran something very heavy and this just crashed stuff. Is there some recommendation/best practice for figuring out what caused this? Are there several possible causes for the Killed interruption, or am I probably looking at the process having run out of memory?
OutOfMemoryError can only be thrown when Julia tries to allocate and the allocation fails. You get OOMed when you write to a page that previously had no data given to it so the OS didn’t actually have any pages free even though it promised you it would.
When I get these, I usually throw some println statements into my program so I know roughly whereabouts it is up to at any given time, and then I run the routine in a terminal, and simultaneously keep a system monitor window (on Linux - but I’m sure there is a Windows equivalent) open next to my running program, so I can get a feel for what is causing the memory problems.
If you need to go deeper than that, then ProfileView.jl is a good place to start.
I don’t think so, as far as I’m aware it sends a SIGKILL (which you can’t recover from). Giving control back to the program when the OS has already decided to (forcefully) stop your code doesn’t really make sense. If it were different, we’d call it the OOM hinter, not the OOM killer.