[hotjoe.com] HotJoe Java Help Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Visit java.com
Please send email if you are having login problems - see the posts below for more info.
Hotmail and Yahoo! users - please see the Hotmail post or the Yahoo! post for information on lost emails.
program slows exponentially  XML
Forum Index » New to Java
Author Message
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?
stdunbar

Newbie
[Avatar]

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
[WWW] [Yahoo!] [ICQ]
 
Forum Index » New to Java
Go to:   
Powered by JForum 2.1.9 © JForum Team
This site run by Scott Dunbar of Xigole Systems. © 2005-2011 - Scott Dunbar
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners
hotjoe.com, xigole.com, and Scott Dunbar have no affiliation with Oracle