-4

Possible Duplicate:
Tuning Tomcat memory and cpu consumption

I've tried profilers but I can't find the source of the problem. is there a command or a way to basically limit how much CPU it can use?

edit:

no its not doing anything useful otherwise i wouldnt be asking.

edit

i'm using windows

Community
  • 1
  • 1
  • 1
    Is it doing useful things while doing this (i.e. handling requests), or simply spinning in a noop? – Paŭlo Ebermann Apr 14 '11 at 13:09
  • @Frédéric Hamidi its not the same question since im not trying to fine tune it nor is my application huge. im simply asking if there is a command like xx-maxpermsize but for CPU instead – newuser9001 Apr 14 '11 at 13:40
  • in that case, check out @atamur's answer: the `nice` command would indeed do the job. Unless you're on a Windows platform, but that's not clear in your question. – Frédéric Hamidi Apr 14 '11 at 14:45
  • 1
    On windows there are also options for modifying the process priority for the cpu scheduler. If you are willing to find something that does this in "javaland" then the answer is "no". There's nothing like -XX:maxCPU. – atamur Apr 14 '11 at 14:52
  • @atamur unless you're new to windows you'd know that cpu priority feature in windows does shit all – newuser9001 Apr 14 '11 at 16:03

1 Answers1

3

depends on your host OS. In Linux you could try "nice"

atamur
  • 1,567
  • 1
  • 14
  • 25
  • 3
    @newuser9001 Yes, it's a real answer. "nice" is a command to make a process monopolize the CPU less (it's still going to do 100% when nothing else wants the CPU, though). While this isn't the solution you're looking for, it's semi-useful anyway. – Zimzat Apr 14 '11 at 13:42