LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Java and CPU usage (https://www.linuxquestions.org/questions/linux-newbie-8/java-and-cpu-usage-4175519999/)

dinodesilva 09-25-2014 01:45 AM

Java and CPU usage
 
Hi everybody,


I use a certain java application to trade the stock market and it consumes 90% my CPU power. And the CPU temp usually remains around 90c. This is a real headache. What causes this problem and what are the possible solutions?

Thank you.

unSpawn 09-28-2014 05:04 AM

Quote:

Originally Posted by dinodesilva (Post 5243938)
What causes this problem and what are the possible solutions?

Generally speaking any application (that is either coded badly or just does anything computationally expensive) will just try to consume the resources it needs (doh). Simply put: the more system resources you have available the better. If you've coded the Java application yourself you may already be aware of some of the profiling / monitoring tools in the List of performance analysis tools else if you haven't get in touch with the developers. They may be able to tell you what information they need to assess if they can improve things.

dijetlo 09-28-2014 05:05 AM

Quote:

What causes this problem
Could be a number of different things, from the app is poorly written to the app was never designed to run with the current version of Java you're rolling.
Quote:

and what are the possible solutions?
Step 1 is find if this app has a log file, if it does, check it.

Step 2 is profile the thing while it's running.A command line system call, like "ps aux" while it's running, gives you something like this (I substituted pulseaudio on my machine for the app you're talking about on yours for this example).
Quote:

[root@kahuna Downloads]# ps aux | grep pulseaudio
willie 2608 0.0 0.1 602536 4184 ? S<sl Sep25 2:13 /usr/bin/pulseaudio --start --log-target=syslog
Jojo 11814 0.1 0.1 602452 4136 ? S<sl Sep25 4:47 /usr/bin/pulseaudio --start --log-target=syslog
gdm 22368 0.0 0.0 579384 2936 ? S<sl Sep26 0:00 /usr/bin/pulseaudio --start --log-target=syslog

Step 3: Call the app using redirection for error messages. something like " myapp 2>> adhoc-myapp.log" and see what it complains about as it's starting up and running.

Step 4 Read the documentation that came with the product. It's has a specific Java requirement, for example. Are you meeting that requirement? Are you using a version of Java several versions past the requirement? Are their any other requirements you're not meeting?

dinodesilva 10-04-2014 03:24 AM

Thank you, unSpawn and dijetlo, taking the time to help me out. I use the latest Java, but the app keeps consuming enormous amount of resources. I contacted the vendor and waiting for a reply. Thanks again for your time.

jefro 10-04-2014 02:36 PM

The write once, run everywhere concept of Java is a trade off. It does consume some power but we haven't yet proven what is running and what is consuming cpu or even if your metric is correct.

What does command top say?

Can it be that network calculation for md5 are burning up your cpu?

What is the quality of the host system?


All times are GMT -5. The time now is 11:54 AM.