In an earlier post, I mentioned a rather serious memory leak issue with the new FEM package in Mathematica 10. Due to this, I’ve now been experimenting with launching parallel kernels, doing some computations in them, grabbing the results and then closing them. This way, I can work around the memory leak issue, since any leaked memory is freed once the kernel doing the computations is closed. Of course this also has the added benefit of greatly improving the run time of my code.
However, this is where I ran into another issue. I tried repeatedly executing the following type of code:
LaunchKernels[];
% Insert any parallel computations
CloseKernels[];
However, this tends to crash after a number of repetitions (sometimes as little as 4, sometimes as many as 10-12). When I say crash, I mean that the main kernel of the notebook crashes and gets restarted, stopping all computations and dropping all variables/function definitions/etc.
The computations themselves don’t seem to be particularly relevant. Here’s a sample code that results in a crash
That’s a good point. I tested it on V9 and had no such problems, the iteration ran up to 1000 without a crash. The problem seems isolated to V10; however, since I need the FEM package, I unfortunately don’t have the option of using V9.
I also noticed that V9 is detecting 8 processor cores on my machine, whereas V10 detects 4 (which affects the number of kernels started by default). I’m using a quadcore processor with two threads per core, so apparently V9 is detecting virtual cores whereas V10 detects physical cores.
Are you loading any custom startup code from an init.m file?
This is a wild guess, but try to uncheck Preferences → Internet Conectivity → Allow the Wolfram System to access the Internet, restart and see if anything changes.
I’m not using any custom startup code, and nothing changed after trying your suggestion. I also tried fiddling with the settings in Preferences → Parallel, to no avail.
I guess it’s time to file a bug report, since there doesn’t seem to be anything obvious I’m doing wrong.