| Author |
Message |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 05/22/2008 08:01:14
|
barbel
Newbie
Joined: 05/01/2006 04:14:31
Messages: 7
Offline
|
Hi,
My problem is that my Java program runs too slowly, and in a way that I don’t understand. What I have written is a simulator that models a chemical reaction.
The code seems to work ok, giving the kind of output I expect. As part of the input parameters I specify the “size” of the system that is reacting. For a very small system, this runs to completion within a few minutes on a PC, which is fine. However, as soon as I increase the system size, the execution time increases exponentially, in the sense that doubling the system size increases the execution time by far more than a factor of 2. This causes the problem that, for a system size big enough to give a useful output, the execution time quickly ramps nastily.
I realise that any code (including mine) could be optimised for speed, given enough time and attention. But I wondered if the symptoms of “exponential slowing” that I’m finding are a pointer to something else other than code inefficiency being the problem.
Any suggestions?
|
|
|
 |
![[Post New]](/templates/default/images/icon_minipost_new.gif) 05/22/2008 08:12:17
|
stdunbar
Newbie
![[Avatar]](/images/avatar/a87ff679a2f3e71d9181a67b7542122c.png)
Joined: 06/22/2005 14:51:37
Messages: 849
Location: Superior, CO, USA
Offline
|
In general I would expect this to be a coding issue. However, one other possibility would be that as the program runs it gets close to the limit on memory and the JVM is spending alot of time doing garbage collection. This is pretty easy to test. The default memory size for the client VM is 64M on, I believe, most platforms. Pass the flag "-Xmx256m" to increase the maximum size to 256M. This may not do anything but, again, if the JVM is spending significant amounts of time garbage collecting it could have an affect.
|
Thanks for using the forums at hotjoe.com |
|
|
 |
|
|
|
|