• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

CPU Usage

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 1923
Scala Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
John Ryan
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cheers guys................
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic