Forums Register Login

CPU Usage

+Pie Number of slices to send: Send
Hi all,
This may sound like a silly question for a somewhat experienced programmer to be asking but I need some pointers/help with diagnosing excess CPU usage by my application.
What Im looking for are some introductory articles/tips that explain what are the common reasons for high CPU usage in a Java application. We have a number of calls to a database plus calls to a number of third party libraries so its possible the problem could lie in any of these.
Im ashamed to say but I dont fully understand what are the factors which lead to overuse of the CPU. I understand that a large number of uninterupted instructions could contribute to this but Im somewhat vague on other issues such as the effects of IO and memory allocation issues.
All feedback appreciated.
John
+Pie Number of slices to send: Send
Nothing to be ashamed about. I've been on a performance kick lately and I've dug up some valuable resources. Sun has a couple of on-line books. Advanced Programming for Java 2 has an introductory chapter on techniques and Java Platform Performance goes in-depth. Of course, if you are using a database, there's other performance considerations. Java Performance Tuning is a clearinghouse for tips on Java performance, including application servers and database servers, but be aware that some of the tips for earlier JVM's are not relevant for the newer Hotspot VM's.
If you want a good performance book, I keep going back to the
Java 2 Performance and Idiom Guide. Their #1 recommendation: A fast computer with a lot of memory. There is no substitute for power.
It's also a good idea to move your DB server and app server to different computers so they aren't competing for the CPU and other resources.
Good luck!
[ May 11, 2004: Message edited by: Joe Ess ]
+Pie Number of slices to send: Send
I would suggest using a profiling tool like mentioned in this thread: Tool For Code Optimization
If the database is already on a different machine, calling it shouldn't lead to much cpu-load.
If the profiler tells you, that the problem is in the 3-rd-party tools, you avoid reading the books (but they might be interesting allthough)
[ May 11, 2004: Message edited by: Stefan Wagner ]
+Pie Number of slices to send: Send
Cheers guys................
catch it before it slithers away! Oh wait, it's a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 818 times.
Similar Threads
JUnit Success cases
memory trace of the server with 2 instances of tomcat 7 running
IronGrid Releases IronEye Cache - Fix performance on the fly
Current Hour
Measure Java CPU usage
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 14:23:10.