How long lasts the unicity (if any) of the System.identityHashCode()?

How long lasts the unicity (if any) of the System.identityHashCode()?
I created code that keep track of seen identityhashcodes for instances
created and unreferenced in a loop.
**** I was surprised to see that these identityhashcode can be reused! ****
The language spec says noting about the unicity of those (at any given time) and especially not for periods of tiem.
Spec menyions that most jvm would use the heap address (which would explain why these identityhashcode could be reused)
**** The question is:
At what time is an identityhashcode invalidated and reusable?
If I have a finalize() method, at which time the object is considered unreferenced, could its identityhashcode be reused while the finalize() is running?
My problem is that I associated data to an object, in an external diskcache, by a key whose value is the identityhashcode, (trying to make the key unique), and I must garbage collect it.

Casually? yeah right, 64bit platforms are just a minor
detail.... ;-)
I wasn't clear about my hopes. I just hoped that for
reflecting new architectures, they would had a new
method
like System.getUniqueObjectID(Object):long
Basically, if sun does not add that, it means that
they beleive the java programmers do not have a need
for addressing/keying object instances uniquely, and
we should just do for-loops with "=="....
I will post an RFE to sun, we'll see.
Thanks.It is not required that hashCode every return a value larger then an int. There is no requirement that
two different objects return two different hashCodes. There is only the requirement that if two objects are
the same then they return the same hashcode. Most 32 bit JVM's do not produce a unique hashCode value
for all objects. Because of this there is also no need for 64 bit JVM's to return unique hashcodes. Hence
64 bit JVM's do not need more then an int to represent the hashCode.
The equals() method (or ==) is used to determine whether two objects are equal. Not the hashCode.
Increasing the size of hashCode to a long would break a large number of classes in the JDK all of which
expect an int. HashMap/hashTable/HashSet are the prime users of hashCode. They do not require a value
larger then int as they use the value to index into an array. Arrays cannot be larger then 2^31 elements
long. This also will not change on 64 bit JVM's as changing this limitation would break most of the API's.
matfud

Similar Messages

  • Anyone used hughesnet to download iOS 5 to iPad2.  How long did it take?  Any problems?

    Anyone used highesnet to download iOS 5 to iPad2?  How long did it take?  Any problems?

    The one time I had to send my iPod in for repair, it was back in my hands seven days later. I don't think you should call and gripe. I think you should call and politely ask for an update.
    Best of luck.

  • HT4623 How long does it take to check for the new update?

    My iPod cannot check for the update.
    Normally how long does it take to check for the new update??

    How are you Checking for Updates...
    JinMoo wrote:
    My iPod cannot check for the update.
    What happens when you try... Any Error messages or Alerts...

  • If i create a new alias in my iCloud account, and forgot the password and can´t actually have open the account in any of the devices, how can I recover my password?

    If i create a new alias in my iCloud account, and forgot the password and I can´t actually have open the account in any of the devices, how can I recover my password?

    Welcome to the Apple Community.
    iForgot.com

  • How long does it take to delete all the files in a lost MacBook Pro?

    How long does it take to delete all the files in a lost MacBook Pro?

    Quite a while since there may be 1/2 million files or more to delete. There is only one quick way, and that is to reformat the drive.

  • How do I use Firebug with a website I created? I want to see how long each thing takes to load on the page. The server is very slow.

    I have created a website/blog with Wordpress. It appears to be on a slow server because it can't be opened or takes forever to open. A representative from Wordpress told me to download Firebug to find out how long each thing takes to load on the page. I downloaded Firebug but I can't figure out how to use it. Please advise.

    OK. You've kind of skipped over the reason why you want to go back five hours, but my assumption would be that you've made changes to a Pages file that you want to revert.
    There are two ways to tackle this. From Pages itself, open the current version of your document, and from the File menu, click Revert To, and Browse All Versions. You'll then be in the Time Machine interface for that file, and can browse back to the version you want.
    Or, outside of Pages, you can select the file (or the folder it was originally in, if you've since deleted it) and enter Time Machine from the TM menu (it sounds like you've already tried this?)
    best
    Matt

  • I have imported contacts from Outlook to Mail and they have synced via iCloud to my iPhone 3GS. I can't get my iPhone to make a call using these contacts but if I dial the number of any of the contacts on the keypad, the call DOES work! Help me please!?

    I have imported contacts from Outlook to Mail and they have synced via iCloud to my iPhone 3GS. I can't get my iPhone to make a call using these contacts (it tries but then says call ended) but if I dial the number of any of the contacts on the keypad, the call DOES work! Help me please - is there something I need to do to the contacts because tehy came from Outlook? Thanks

    Thank you for replying.    Yes I deleted the old email address..   

  • IPad: Launch YouTube, click Add a comment. Google sign-in box cannot be dismissed by pressing the X. This was not the case in any of the four iPads in earlier OS versions. Only occasionally it is possible to press the X and close the sign-in box.

    iPad: Launch YouTube, click Add a comment. Google sign-in box cannot be dismissed by pressing the X.
    This was not the case in any of the four iPads in earlier OS versions. Only occasionally it is possible to press the X and close the sign-in box.

    if this is the first time to happen in this version of the app. then it may just be a flaw with that version, if you have already un-installed and re-installed the app then it will just be a waiting game at this point until youtube hears and it and fixes it

  • How long-lasting is the correct one for a battery in a Mac Book?

    To whom it may concern,
    I just bought a brand new Mac Book last month, and some of the things I got in mind when I bought it, was the battery long-lasting life, 10 hours, wow! Today I am checking the features of the MacBook and it says 7 hours long-lasting... and you know something, to say that it works seven hours is more real than it works up to ten hours because I have been using my brand new MacBook up to eight hours from 100% to 1% with the display off.
    I would like to know why did you decide to fix the information about the features of the battery? Thank you.
    Today's features
    http://www.apple.com/macbook/features.html
    2009's features
    http://replay.waybackmachine.org/20100522032553/http://www.apple.com/macbook/fea tures.html

    Hi jarhqro and welcome to Apple Discussions.
    There are no Apple staff here, it is just member to member forum so you will not get an official answer.
    Battery life depends on what you use your computer for. Using it for light browsing with all power saving options set will give you the max but intensive use and no power saving options set will give you the minimum.
    Just use and enjoy you new Mac book.
    Regards from England,
    Alan

  • How long does it normally take to download the windows support software

    I am trying to use Boot Camp to install Windows 7 but the system seems to freeze during "Downloading Windows support software..."  Does anyone know how long this process normally should take?

    600MB so should, 10 minutes max, real? too long by 8 hrs
    this is what "support for Windows on Mac" ever since.it went to a DL service
    Compare that to 1000s of people installing Lion, iOS and other updates
    and that no change or improvement in months and the yr since it was offered.
    This is what lack of having a DVD in part, or not just post forall Mac ownerslike any other motherboard vendor does for customers.ps I have had adl link but it is no longer current latest driver set I've been told.

  • How long should I charge my ipad for the first time?

    I have bought an Ipad2 and I was wondering if the first time charge will be "different". thanks

    You don't need to charge an iPad when you first get it. You can charge at any time.
    FYI
    The quickest way (and really the only way) to charge your iPad is with the included 10W or 12W (5W on Mini) USB Power Adapter. iPad will also charge, although more slowly, when attached to a computer with a high-power USB port (many recent Mac computers) or with an iPhone Power Adapter (5W). When attached to a computer via a standard USB port (2.5W, most PCs or older Mac computers) iPad will charge very slowly (but iPad indicates not charging). Make sure your computer is on while charging iPad via USB. If iPad is connected to a computer that’s turned off or is in sleep or standby mode, the iPad battery will continue to drain.
    Apple recommends that once a month you let the iPad fully discharge & then recharge to 100%.
    How to Calibrate Your Mac, iPhone, or iPad Battery
    http://www.macblend.com/how-to-calibrate-your-mac-iphone-or-ipad-battery/
    At this link http://www.tomshardware.com/reviews/galaxy-tab-android-tablet,3014-11.html , tests show that the iPad 2 battery (25 watt-hours) will charge to 90% in 3 hours 1 minute. It will charge to 100% in 4 hours 2 minutes. The new iPad has a larger capacity battery (42 watt-hours), so using the 10W charger will obviously take longer. If you are using your iPad while charging, it will take even longer. It's best to turn your new iPad OFF and charge over night. Also look at The iPad's charging challenge explained http://www.macworld.com/article/1150356/ipadcharging.html
    Also, if you have a 3rd generation iPad, look at
    Apple: iPad Battery Nothing to Get Charged Up About
    http://allthingsd.com/20120327/apple-ipad-battery-nothing-to-get-charged-up-abou t/
    Apple Explains New iPad's Continued Charging Beyond 100% Battery Level
    http://www.macrumors.com/2012/03/27/apple-explains-new-ipads-continued-charging- beyond-100-battery-level/
    New iPad Takes Much Longer to Charge Than iPad 2
    http://www.iphonehacks.com/2012/03/new-ipad-takes-much-longer-to-charge-than-ipa d-2.html
    Apple Batteries - iPad http://www.apple.com/batteries/ipad.html
    Extend iPad Battery Life (Look at pjl123 comment)
    https://discussions.apple.com/thread/3921324?tstart=30
    New iPad Slow to Recharge, Barely Charges During Use
    http://www.pcworld.com/article/252326/new_ipad_slow_to_recharge_barely_charges_d uring_use.html
    Best Practices for iPad Battery Charging
    http://www.ilounge.com/index.php/articles/comments/best-practices-for-ipad-batte ry-charging/
    Tips About Charging for New iPad 3
    http://goodscool-electronics.blogspot.com/2012/04/tips-about-charging-for-new-ip ad-3.html
    How to Save and Prolong the battery life of your new ipad
    https://discussions.apple.com/thread/4480944?tstart=0
    Prolong battery lifespan for iPad / iPad 2 / iPad 3: charging tips
    http://thehowto.wikidot.com/prolong-battery-lifespan-for-ipad
    iPhone, iPod, Using the iPad Charger
    http://support.apple.com/kb/HT4327
    Install and use Battery Doctor HD
    http://itunes.apple.com/tw/app/battery-doctor-hd/id459702901?mt=8
    To Extend a Device’s Battery Life, Get to Know It Better
    http://tinyurl.com/b67c7xz
    iPad Battery Replacement
    http://www.apple.com/batteries/replacements.html
    In rare instances when using the Camera Connection Kit, you may notice that iPad does not charge after using the Camera Connection Kit. Disconnecting and reconnecting the iPad from the charger will resolve this issue.
     Cheers, Tom

  • I ordered IPod touch 5 and it is shipping. Currently located in shanghai, china. How long until I can expect it in the USA (WI)?

    Okay, so after waiting, which I had anticipated, my I Pod touch 5 is in shipping. Currently it's in Shanghai, CN.
    I'm wondering how long it will take to reach the USA (WI) if it says it's in transit today in Shanghai. It's supposed to arrive on the 26th sometime.
    I thought I'd ask and see what other people's experiences have been. Sorry if this has been asked a zillion times. Thank you so much.

    Thanks for your help. I figured it was right on track, but wanted to be sure.

  • So how long is lebanon going to wait for the symbi...

    It's been almost more than a month since nokia released it,,, and it was supposed to be a worlwide release on oct 24th,,,, i don't feel like waiting for christmas nokia,,,,, we want the symbian belle preferably before the end of november at least..

    aSsirovich wrote:
    It's been almost more than a month since nokia released it,,, and it was supposed to be a worlwide release on oct 24th,,,, i don't feel like waiting for christmas nokia,,,,, we want the symbian belle preferably before the end of november at least..
    Belle firstly has not been released.
    secondly Belle will not be released for existing symbian ^3 or symbian anna phones till after the whole world has Anna, to which Canada and Australia and some other places still do not have.
    And lastly Nokia do not do world wide releases, they are released based on carrier approval.
    So when it is released it will be given to the carriers first for testing then once approved it will then be released to the public. If it is not approved due to errors it will be taken back and fixed, then resubmitted for testing and so on until it is approved. However if the carrier just says no they dont want it released, then Nokia will not release it at all to any customers that are on that carrier.
    So just like Anna, you will have to wait till it is ready and testing has been completed and the carriers give the approval.
    Skyee has confirmed that Belle will not be released until after the Anna roll out is completed.
    Please be patient

  • After download completion, how long os x installer takes to install the software

    I am downloading the Mountain Lion OS X using disk utilities / recovery menu, after completion of downloading, how long the installer takes to install
    OS X
    If anybody knows about it, pls advise me.

    The length of the download depends upon how fast your internet connection is. The download is over 4 GBs.
    If you erase the drive before you install Mountain Lion then it should take around 20 minutes, plus or minus. If you are upgrading or reinstalling then it should take around 35 minutes, give or take. These estimates are impacted by the speed of your machine and hard drive.

  • Wie lange haben Apple Produkte Garantie in der EU? How long do Apple products have warranty in the EU?

    Auf dieser Webseite ist die Garantiezeit der Apple Produkte beschrieben. https://www.apple.com/de/legal/statutory-warranty/
    Haben nun Produkte von Apple in der EU 2 Jahre Garantie oder nur ein Jahr?
    Es ist nicht verständlich für alle.
    On this webpage the duration of warranty in the EU is stated. https://www.apple.com/de/legal/statutory-warranty/
    Do Apple products have 2 years warranty in the EU or just one?
    This is unclear for everybody.

    Die Garantie beträgt in der EU ein Jahr, kann aber durch einen kostenpflichtigen Apple Care Plan verlängert werden.
    Wie lange ist mein iPhone durch die Apple-Garantie abgedeckt?
    Das iPhone ist durch die beschränkte Apple-Garantie ein Jahr lang abgedeckt. Der Garantieservice für infrage kommende Reparaturen steht Ihnen für zwölf Monate ab dem ursprünglichen Kaufdatum kostenlos zur Verfügung.
    Die Leistungen aus der beschränkten Apple-Garantie und aus AppleCare-Produkten verstehen sich zusätzlich zu der gesetzlichen Gewährleistung in der EU. Hier finden Sie weitere Informationen.
    How long is my iPhone covered by Apple’s warranty?
    Apple's Limited Warranty for iPhone covers your iPhone for one year. Warranty service for eligible repairs is available at no charge for twelve months from the date of original retail purchase ("date of purchase").
    Apple's Limited Warranty and AppleCare product benefits are in addition to rights provided by the EU statutory warranty. Learn more.
    copied from Apple - Support - Service Answer Center

Maybe you are looking for