Results 1 to 2 of 2
- 03-19-2012, 07:55 PM #1Member
- Join Date
- Mar 2012
- Rep Power
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?
- 03-20-2012, 10:38 AM #2Moderator
- Join Date
- Apr 2009
- Rep Power
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.Please do not ask for code as refusal often offends.
** This space for rent **
- By haribabu1111 in forum New To JavaReplies: 1Last Post: 12-13-2011, 06:07 AM
- By kkji in forum JDBCReplies: 1Last Post: 11-07-2011, 08:55 PM
- By AWPtic in forum New To JavaReplies: 6Last Post: 05-06-2009, 04:22 AM
- By makpandian in forum New To JavaReplies: 6Last Post: 02-28-2009, 07:55 PM
- By prince24 in forum New To JavaReplies: 2Last Post: 07-11-2007, 06:54 PM