Is that OK to leave a small endless loop script running on server?

[Linux VPS] Process running 201% CPU Usage.?

  • I run an Ubuntu 64Bit VPS. I was running a Minecraft (Bukkit) server. Somebody attacked my server and I didn't notice. I went to use a command and it said 'Fork: Not enough allocated memory". My first thought: "Lolwut". Anyways, I typed 'top' in to SSH and it said Java was using 201% CPU usage! Is there any way to fix this issue? Some things that I thought of (if possible): Maybe run some kind of script that can read the CPU usages and if it begins to run over a certain limit it'll use a command(as if killall java & killall screen). Or just kill the process without using a command line. I'm not sure if this is possible, I'm just throwing out random ideas that come to mind. Please help? I'd like to run a server, but I'm afraid to leave it going while I'm gone in case if this happens again.

  • Answer:

    That could well be correct for a multi-threaded application, and Java makes threads programming relatively easy. If you have e.g. a quad core processor each core is considered separately and you actually have 400% CPU to go at.

Saviour at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.