Short version

Why does Java consume far more CPU time when launched via start-stop-daemon than when launched directly from the terminal?

OS: Debian Squeeze x86

Java version: Sun Java SE 1.6.0_24

Long version

When Java is launched from the terminal using the following invocation, top reports that the CPU usage of the process hovers around 5%:

java -server -Xincgc -Xmx512M -jar craftbukkit-0.0.1-SNAPSHOT.jar nogui

Whereas running it via start-stop-daemon with the following (seemingly identical) invocation causes the CPU usage to spike to 100%:

start-stop-daemon --oknodo --start --background --make-pidfile --pidfile=/var/run/minecraft.pid --chdir /opt/minecraft --chuid minecraft --exec /usr/bin/java -- -server -Xincgc -Xmx512M -jar craftbukkit-0.0.1-SNAPSHOT.jar nogui

What am I doing wrong? What's causing this discrepancy, and how can I fix it?

Update - strace output

strace -p $(pidof java) outputs the following, regardless of whether the process was launched directly or via start-stop-daemon:

futex(0xb6a5fbd8, FUTEX_WAIT, 3158, NULL

The daemon is still running correctly, it's not a hard lock.

link|improve this question
Run strace on the process to find out what is it doing or trying to do: strace -p $(pidof java) -- (or you can just look up the pid yourself) – cstamas Jun 13 '11 at 20:22
@cstamas: Thanks for the reply; I've updated the question with the output. – robinjam Jun 13 '11 at 20:31
sorry I have no idea then. – cstamas Jun 15 '11 at 7:54
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.