# Kernels permanently consume 100% CPU

I have a problem with Mathematica kernels consuming 100% CPU, even when they seemingly idle: I start Mathematica (version 10.1.0 for Linux x86, 64 bit on Linux 2.6.32, server with 4 cores, 16 GB RAM). A process viewer such as "top", however, reports 100% CPU load on the (two) kernels, even before I have issued the first command. The command prompt works fine and is responsive and fast as always, but the kernels remain permanently at 100%, even hours after startup. The same happens on all additional kernels after running ParallelTable[] or such. Once I quit the frontend, the kernel processes terminate as they should.

I have tried renaming the .Mathematica/Kernel/init.m file and also the Applications/ folder to rule out any faulty initialization on my side. Besides that, have not modified any system folders or files.

top reports a stable memory consumption of VIRT=1051m and RES=71m or similar both for either kernel, so it doesn't look like the Linux kernel is swapping (the server is was idling when I ran the last test, anyway).

It looks like the kernels are constantly trying to do something in parallel to their regular (and fully functional) operation that hangs.

• Try deleting the ~/.Mathematica/Paclets directory. – ilian Sep 21 '15 at 14:13
• I don't have access to a Linux installation, but out of curiosity, do you have access to another similar process viewer, to see if the problem is actual load, or in the load viewing and reporting instead? – MarcoB Sep 21 '15 at 14:14
• I checked the processor load using top and htop on my linux 3.16 amd-64 machine, running Mathematica 10.1.0.0 . Neither of the two process viewers shows any load after I launched two kernels. – andy269 Sep 21 '15 at 15:34
• Is this on an empty notebook? – Sjoerd C. de Vries Sep 21 '15 at 20:10
• I had a similar problem when using remote kernel on a linux cluster, but I end up avoiding 10.1 and 10.2 and never solved it. – xslittlegrass Sep 21 '15 at 21:49

## 1 Answer

OK, issue solved. The problem is apparently caused by a bug in the Linux kernel related to the insertion of a leap second and is only apparent when queried from Java. A solution is given here (requires super user permissions, but no reboot or even restart of Mathematica): Java leap second bug

• Glad it's solved (+1). Was it the strace that pointed in this direction or something else? I'd include this link in the answer, since Java is most likely not relevant (it is not used by the Mathematica kernel on startup) – ilian Sep 23 '15 at 15:06
• @ilian: Yes, I googled the strace result and found a post that described the same situation, unrelated to Mathematica. Thanks for the hint. It may be worth adding a check to Linux versions of the Wolfram Kernel to check for this leap second problem? – RonH Sep 23 '15 at 20:02