I wrote a MCMC script in Julia, which basically means that I ask the computer to compute up to n iterations of some function. This script executes perfectly when n is something relatively small like 1000 or 10000. However, when I bump the same script up to n=100000, my VS Code terminal just closes without reporting an error. This has been incredibly frustrating, as I would like to at least know what is causing the issue. While the terminal closes, the bottom bar shows that Julia is still "evaluating," but when I open "top" in my computer's terminal, it shows that Julia is not doing anything.
I honestly tried to create a minimal working example, but was unable to after a couple of hours. I have no idea how to even debug this problem, so any help is incredibly appreciated.
This is all happening on Ubuntu 22.04 LTS, if it helps.
CodePudding user response:
A good method to debug this is to use an external Julia REPL as described here.
In short,
- Start a terminal (inside or outside of VS Code)
- Start Julia in that terminal
- Use the
Julia: Connect external REPL
command in VS Code - Copy the code snippet into the newly started REPL
- Run the code that crashes Julia -- you'll still have access to everything that got printed before.
Another option is to enable the julia.persistentSession.enabled
setting and restart your Julia process. You'll see that Julia now runs inside of tmux, which will also stay around after Julia exits.
CodePudding user response:
VS code sometimes crashes when a file is too large. The larger the number, the larger the file size, so maybe your computer just isn't good enough to run your program.
I would suggest installing Filesize from the vscode extensions library, so you can test to see if the file size is any larger when inputting the larger number.
It could also be in the code, but I don't use Julia so I can't help you with that.