Difference between java v1.5 and v1.6
I'm not really a java programmer, but I am responsible for some code that essentially does some monte carlo analysis. In order to obtain repeatability the random seed is set. Up until now this has worked fine. However, the code has recently been moved to a new server running Java v1.7 and I have found that the repeatability has disappeared. It was previously run on a server using Java v1.5.
To test what was going on I have compiled and run the code on a PC laptop. If Java v1.5 is installed and the code compiled under that then the results are consistent with the results on the old server. If Java v1.6 is installed on the laptop then the results are consistent with the new server.
I have checked and the random number sequence is the same on all 3 machines and for v1.5, v1.6 and v1.7.
My only conclusion so far is that there has been a change in number rounding between v1.5 and v1.6. Either that or there is something in the code that is affected by the changes in garbage collection.
Does anyone have any ideas what is going on and whether there is a way of fixing this?
Re: Difference between java v1.5 and v1.6
So the randomisation hasn't changed, which is as expected as that is the contract of a seeded Random.
I doubt garbage collection will have anything to do with it, unless you have timings involved somewhere, but then it would never have been repeatable in the first place.
You might need to look at the version of 1.5 you have and then work forward through the release notes for versions and patches to see if anything obvious has been changed. It's quite possible the version of 1.5 you are using had a bug in it that was since fixed.
The other thing is to Debug big time to see if you can trace where the first difference occurs during an execution.