Link to home
Start Free TrialLog in
Avatar of davidw88
davidw88

asked on

Java/C: Code running longer and longer

Hi experts,

I am puzzled with this so I post to get explainations. I have Java and C code on Linux machine. I found that the Java code cost more and more time. It is the same for the C code. I wrote this C code about one month ago and did not touch it since then. Today I run it and found the running time got doubled. I used clock() to measure time.

How can this code run with longer time? or why do they become slow?

Thanks for any replies.
SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In all my performance problems so far with Java and even C, the best bet is to disable the virusscanner. A scanner trying to read every .jar in it's entirety (McAfee) and deleting it if it finds any problems doesn't do much good for developers piece of mind. Stopping your firewall to block connections to/from your own machine may also help.

I cannot see from here if this would fix your problems, try the other possible solutions as well. But at least this solution is one that might work (given the absolute minimum of data you've supplied to us).
Check whether any other processes are running other than java and c. May be because of that reason these programs are taking moretime.
Avatar of davidw88
davidw88

ASKER

Hi experts,

Thanks so much for all your replies. I called our administrator to check with me together about the processes. We found that another file writing process took so much resources that it slowed my code!!

Objects, Spoxox and Ozo are correct so I split the points among them.

Thanks also go to mbodewes and melchkishore! (melchkishore's answer follows Objects' so I do not assign points to him.)