File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Performance and the fly likes Cause of an application running slow in java ?. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "Cause of an application running slow in java ?." Watch "Cause of an application running slow in java ?." New topic

Cause of an application running slow in java ?.

Praveen Kumar
Ranch Hand

Joined: Nov 06, 2006
Posts: 133
Hi Ranchies,

Recently I faced one interview question " Suppose if the application performance is slow, how you will troubleshoot and what things you will trouble shoot first".

I replied with DB normalization and JVM. I told we can some tools like Jprofile and Jmeter

Please let me know how we will troubleshoot and what are the available tools to do that one.

fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11955

you should always use a profiler first. It will tell you where you application is really slow, letting you focus on what is really needed.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
steve souza
Ranch Hand

Joined: Jun 26, 2002
Posts: 862
If I asked this question I would want to hear the candidate answer it in a scientific well thought out manner. If they quickly said all the things they would change about their code without properly emphasizing their knowledge of profiling, and an understanding that premature optimization is a sin, then in my view they have failed the question.

Profiling the code is the first step. I would elaborate on how you would do this (for example what tools and approach you would use to prove that you have done it before). I would then add doing any steps like DB normalization is premature, until you have found your bottlenecks, and explain why. You should tune where the profiling leads you. Having made it clear you just don't start tuning without evidence, you could then add typical performance improvement areas. IO subsystems such as the database, file, network are typically prime candidates for performance problems. You could add some examples of how you could detect and improve each of these. An example of a database check that can help a lot is to ensure that your tables have the proper indexes. - a fast, free open source performance tuning api.
JavaRanch Performance FAQ
I agree. Here's the link:
subject: Cause of an application running slow in java ?.
It's not a secret anymore!