3

I have so far loving Ubuntu it is perfect for what I have been doing. However, I have been working on this project for a while that takes a few days to compute. The program only requires 1.7GB of heap space, and it uses most of the CPU when it is not being utilized by some other application. Like 13 hours into the program my computer restarts. I have no idea why this occurs.

9
  • Check your log files on anything related. Or create a log file in your project so you can track&trace what it is doing. "Could it be that my Ubuntu is unstable" That is not the definition of unstable: unstable means random crashes, not a reboot that you can recreate on demand. That means it is a bug... but more likely in your project than in Ubuntu ;)
    – Rinzwind
    Jul 8, 2017 at 15:49
  • 2
    Have you checked your CPU temperature ?
    – Ravexina
    Jul 8, 2017 at 15:50
  • I would say it is my program but I have a friend running it on their computer running linux and it has the same specs as he hasn't experienced anything like what I am and he is well into the generation of the program. I think the CPU gets really hot. @Rinzwind Jul 8, 2017 at 15:51
  • It gets hot and runs hot when the program is going. @Ravexina that I am sure about. Jul 8, 2017 at 15:52
  • 1
    You might wat to check if your cooler isn't stuffed with dust. Have been there. Dec 20, 2017 at 18:58

1 Answer 1

5

My guess is that it's not Ubuntu that gets restarted, it should be your CPU that cause a restart because of high temperature.

What I can suggest is to normalize your CPU usage by limiting the process to a portion of CPU capacities. You can do it by tools like cpulimit.

You can install it:

sudo apt install cpulimit

and run your program with a limited CPU:

sudo cpulimit -l 50 command ...

or limit a specific process id:

sudo cpulimit -p $(pidof your-program) -l 40

It cause your computing to take more time but you should be fine.

While using cpulimit check your CPU temperature, make sure it doesn't gets too much hot.

5
  • What I do when I run my program is this. nice -19 java -Xms1800m -Xmx1800m (file name) This allows it to use most of the CPU when it is available but if it isn't it will run with as little as it needs. Jul 8, 2017 at 16:02
  • the efi/bios setting may allow you to set the cpu fan to run constantly. this may help
    – ravery
    Jul 8, 2017 at 16:03
  • @ProgrammingCuber The thing is with nice and nice level you can only control the priority between 100 and 139, however the other 99 will be managed by Kernel and you don't have any control over it. By using cpulimit you are actually limiting the CPU usage it's different from the nice level.
    – Ravexina
    Jul 8, 2017 at 16:05
  • Ah ok so what if I wanted it to use most of the CPU it can? Jul 8, 2017 at 16:08
  • @ProgrammingCuber manpages.ubuntu.com/manpages/xenial/man1/cpulimit.1.html
    – Elder Geek
    Dec 20, 2017 at 19:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .