简体   繁体   中英

Java high cpu usage Debian

When I run any Java program on my Debian server (eg tomcat, jvirtualvm) the cpu usage spikes to 100% and then always stays between 80% and 120%. As jvirtualvm also leads to this problem, I can't really use it to debug. Any ideas how I could find out more? This happens when I use sun-java or open-jdk. I installed both from the repositories.

I did have the similar issue before trying to run tomcat on ubuntu, I was using apt-get to install tomcat packages as it's easy, but it seems very complicated to use.

So I tried installing tomcat from http://ftp.heanet.ie/mirrors/www.apache.org/dist/tomcat/tomcat-6/v6.0.35/bin/apache-tomcat-6.0.35.tar.gz

Just download the tarball, and extract it to /opt like this

wget http://ftp.heanet.ie/mirrors/www.apache.org/dist/tomcat/tomcat-6/v6.0.35/bin/apache-tomcat-6.0.35.tar.gz
tar xfzv apache-tomcat-6.0.35.tar.gz
sudo mv apache-tomcat-6.0.35 /opt/tomcat

Now if you have JDK installed already, just start your tomcat with,

sudo /opt/tomcat/bin/startup.sh

and then access your tomcat,

http://localhost:8080

You might need to remove your existing tomcat packages first.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM