Does a HashMap capacity ever decrease

Just wondering about the memory allocation to a HashMap.
When the number of entries in the hash table exceeds the product of the load factor and the current capacity, the capacity is roughly doubled by calling the rehash method. What happens if over half the entries are removed, is the rehash method called to decrease the capacity.
Could not find any information to that would confirm. I assume it would but i have no proof.

I haven't looked through the code yet, but my assumption would be that no rehash would occur unless you chose to do it explicitly.
The reasoning would be that since the map had (historically) been required to contain largeNumber entries, it might well be required to do so again in the future and that the performance gain would be worth the relatively minor memory wastage.
Off to investigate...
Dave.

Similar Messages

  • I've tried everything I can think of to get my Iphone 4S to play albums like an Ipod does.  All it ever does is play the songs but not the albums in alphabetical order.  I used to think I was reasonably intelligent until I butted heads with this phone.

    I've tried everything I can think of to get my Iphone 4S to play albums like an Ipod does.  All it ever does is play the songs but not the albums in alphabetical order.  I used to think I was reasonably intelligent until I butted heads with this phone.

    Yes i've tried all of that. I've turned it all the way on and off and erased all of my music and put it back on and nothing works. And with the breaking up CDs and putting into compilation categories i have already fixed all of that stuff. It's fine it just doesn't show up in the list of artists. I can find the album in the songs category and the albums category it's just it doesn't show tha name of the artist. All of the other albums that i downloaded before i updated my itunes to th most recent update are fine. It's just the two that i downloaded afterwards. Thanks for trying though.

  • Going round in ever decreasing circles

    Hi There,
    what a story!!!
    I had two separate BT lines coming into my home.Line A for broadband and my home office use. LIne B for domestic use only.First called BT in October to advise that at the end of December this year I wanted to terminate Line A and at the same time arrange for broadband to be supplied to line B.  Simples....NO??
    Person I spoke to said too early to arrange this call back mid November? This I duly did.
    I got an e-mail confirmation that Line A would be terminated end of NOVEMBER. I thought well it's not what I want but ok I will go with it as I also got confirmation that line B broadband would be connected 20th November.
    Line A was terminated as expected. LIne B was not supplied with the broadband as expected.When I called I was directed to the Indian call centre.I was told there was a problem but evrything would be ok and it would be supplied on 30th NOVEMBER.Why am I so gullible?
    Never happened....so back to call centre in India only to be told that there was indeed a problem and that my order would need to be re-entered again and would not be connected until 7th DEC.During this call  iwas told to leave my phone connected to India while the ordere was re-entered (took over one hour) and at the end of this process the guy assured me he would call me back on Mon 2nd to confirm that he had managed to get the connection moved forward to the 3rd DEC (today)
    Needless to say he did not call me!! (why am I so gullible)
    I already have my HUB from line A ready to go.
    Why am I going round in ever decreasing circles
    I have honestly spent hours on trying to get this resolved.

    Hi p4dimac,
    Welcome to the forum and thanks for posting. I’ll be happy to look into this for you. Drop me an email with the details. You’ll find the “contact us” form in the about me section of my profile.
    Cheers
    David
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry but we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)

  • Does overcharging iphone/ipad/ipod decrease battery life ?

    does overcharging iphone/ipad/ipod decrease battery life ?

    If you haven't, I'd check out this kb for starters.....
    http://support.apple.com/kb/HT4060

  • Does apple plan on ever having a wireless backlit keyboard for the iMac line

    Does apple plan on ever having a wireless backlit keyboard for the iMac line

    Meanwhile Logitech makes one that might suit:
    http://www.logitech.com/en-us/product/illuminated-keyboard-for-mac-ipad-iphone

  • My  BEATS speakers are connected to my Mac but I have no audio and do not understand how to turn off the speaker. I press the power button and not shut off. And the white light behind me indicating that this synchronized, does not turn off ever.

    My  BEATS speakers are connected to my Mac but I have no audio and do not understand how to turn off the speaker. I press the power button and not shut off. And the white light behind me indicating that this synchronized, does not turn off ever.

    Hello Sabroso007
    Check out the article below to troubleshoot the sound output to your Bluetooth speaker. Check in System Preferences > Sound to see what the output is set to.
    OS X Mavericks: Set up Bluetooth audio devices
    http://support.apple.com/kb/PH14217
    Regards,
    -Norm G.

  • Ipad disk capacity/space decrease

    After I update my ipad from 4.3.5 to 5.0, my disk capacity (total disk space) has decreased 1GB in total. anyone have solution to this??

    Same boat. I was part of the beta, running it on AppleTV, iPad2, and five or six iPhone 4's. Bluetooth stack is the devil. AppleCare is your friend.
    A read-only partition IOS was unable to over-write/delete at the time of the upgrade appears to be one on the list of things that could of happened. There have been a lot of CSS injection attacks, and the PDF exploit earlier on in the lower versions. There's some other stuff, but over all it's pretty secure. I found out about both those problems months before Apple released notice about them/started working on the patch - Somewhere around 4.2.6 - 4.2.8, Verizon thought I was a liar and I had to pay for 200 bucks worth of data charges, and I'm still fighting with iTunes over about 120 in charges. (Ever notice how when you type a password the last letter shows for a few seconds? They either had a VPN and were watching, or read it from device memory via keyhash or an insecure plaintext file saved with my password)
    Anyways:
    Look in your diagnostic logs under Settings, General, About, Diagnostics & Usage, and then Diagnostic Usage Data.
    You might see a lot of logs listed with awdd_, or LatestCrash, or a bunch of other .plist related logs. See if you see anything in there that does not look normal. A lot of kernel panics/crashes is a good indicator of a bigger problem. You can also see in some of the logs a list of different libraries that were loaded, being used, threads, etc.
    I honestly haven't come across a device yet that wasn't either A) Jailbroken or "Rooted" (without users knowledge, then they sandbox and/or use a library (libphide I believe it was) that hides/restricts everything from you. Turning on debugging in safari can show you when css attacks are attempted. Leaving java, cookies, bluetooth, and wifi off can help, but if someone wants in, well.. It's far from impossible.
    B): MobileMe/iCloud replication is/was corrupt. I've had it replicating my push replications, downloading the same thing over and over then sending it back to the server again, eating up the "Other" Catagory (Documents and Data option in iCloud). Turning everything off to iCloud except find my iPad, deleting everything from the iPad by hand first (sounds silly, but you'd be surprised). then going to www.icloud.com, do a remote wipe, then do a manual recovery from iTunes and try reinstalling.
    If that doesn't help to be honest you'll need to bring it to the AppleStore.
    If want to take a screen shot of your log list of any of the ones showing crashes (probably will be several since it's rather long) i'll be glad to let you know if anything looks out of line. I've unfortunately got too much experience with problem children.
    Good luck if I don't hear from you, my 64gb is showing 58.1 total capacity with 57.8 available on a "setup as new device" with no iCloud association as of yet.
    I've replicated the problem manually on purpose on another device, and the "Read only" partition is/can cause this problem.

  • Why Does Force Quit Rarely Ever Work?

    I was a big fan Leopard. Before my upgrade to Snow Leopard, I had a very stable system that rarely had any problems. When I did have an issue, it was usually a problem with a Finder lockup up and my excitement about Snow Leopard was that the Finder was being re-written and would hopefully provide some additional stability. I have to say, I've been disappointed to see that isn't the case. I'm running 10.6.3 and am forced power off my machine several times a week because things lock up. That compares to maybe a couple times a year with Leopard.
    I'm a long time Mac user and know the tricks to troubleshoot my system and have been slowly disabling things and not running certain software to try and pin down the cause. It looks like it's either Safari or iTunes but it's really difficult to tell for sure.
    In any case, the reason for my post is my frustration with the Force Quit function that is rarely useful. When I get the the dreaded "spinning beach ball" the first thing I try to do is force quit the offending application. Right clicking on the icon in the dock usually freezes the dock. The Apple menu then won't pull down and if I'm able to use another utility I have in my menu bar to activate a Force Quit, it locks up after the menu drops down. This happens time and time again. My mouse moves and I can click on certain windows but am never able to regain control. Rarely (maybe 10% of the time) if something goes wrong and I get the "spinning beach ball," am I able to access the Force Quit function to kill the (application not responding). The rest of the time, I have no choice but to do a hard boot by powering off.
    Why isn't Force Quit kind of like Activity Monitor but implemented as such a low level function that it can almost always be invoked (through a keyboard command or menu), even when the Finder has hung. It appears the problem is the Force Quit is tied to the Finder and when the Finder hangs because of another application (this also puzzles me) there is no was activate the Force Quit because until the offending application is killed, the Finder won't respond.
    I'm sure over time, whatever is causing the freezes will be fixed and the stability of my system will return but Snow Leopard was supposed to be a more compact and finely tuned version of Leopard, re-written to support 64 bit and getting rid of most of the old Carbon system applications. The Finder was supposed to be a primary beneficiary of that effort and from my experience, it's less stable and provides no additional protection from locking when another application hangs.
    As a Mac user, I don't expect to ever have to hard boot my machine to regain control. It risk corrupting my hard drive and the application flies that were left open. My Mac used to be a picture of stability but has gone done hill since moving to Snow Leopard. Kind of ironic given the pitch for Snow Leopard was decreased bloat and increased stability.

    Overall, I'm sure the numbers are small but the point of these forums to is discuss real problems people are having.
    I never denied that you're having problems, and tried to give you some suggestions and get more information to help you further. However, because I pointed out that your statements about being disappointed in SL are unfounded, you jump down my throat! Do you want to solve your problems or do you just want to whine about it?
    Now...could something on my machine be corrupt?
    Certainly.
    Could one of my programs have a bug and be causing the issue?
    Certainly.
    Could be but generally when this has happened, only Apple software has been running
    Are you certain? There are often little third-party background processes or kernel extensions that people forget about, since they don't show up on the Dock. This is one reason I've asked you about starting up in safe mode.
    Somehow I fail to see how the OS is blameless. Because it should work but doesn't means something has gone wrong somewhere.
    The OS cannot be blamed for bugs in third-party software or corruption from any number of possible causes, both of which are the most likely reasons for your problems. The bottom line is that there is no consistent pattern of issues with the current version of Snow Leopard that would indicate that bugs in the system are causing your problem. (Note that I'm not basing this solely on the behavior of my machine, but on the behavior of multiple machines that I have seen as well as reports on forums.)
    I just wished Forced Quit was more reliable.
    Force quit is reliable, unless you have a third-party app that is interfering with it at a very low level or a very serious problem. That's my third time saying that, and it's based on experience with probably more than 100 Macs in more than two decades, as a user, developer and system administrator.
    Do you want to solve the problems that are behind your issues with force quit or not? You have not told us what you have tried. You have not responded to my questions about repairs to the hard drive, starting in safe mode or using another user account.

  • In settings why does it say capacity 28gb instead of 32gb

    Hope someone can explain as in iPhone it says capacity 16gb!

    I happened to be browsing the internet tubes, and stumbled upon this thread. I'm afraid your answers aren't exactly accurate.
    This "missing space" is not being taken up by the OS or whatever. iOS is what accounts for part of that orange "other" space and it is actually contributing to your used space. That "missing" 2GB is a simple explanation of math and measurements. The problem is that there are two different measurement standards for Gigabytes: decimal and binary. Decimal measures a GB as a literal billion bytes (1,000,000,000). That is what is in your iPhone. (16GB=16,000,000,000/32BG=32,000,000,000).
    Now, binary doesn't measure it that way. Binary measures in 1024 (1KB=1024bytes/1MB=1024KB/1GB=1024MB). It should be noted that both standards recognize there are 8 bits per byte. While your iPhone does include 16GB, it's being judged by the decimal standard. However, your iPhone's software measures by the binary standard. Do the math, starting with 16,000,000,000 bytes, and you divide by 1024 three times, you get your binary standard: 14.9GB. The 32,000,000,000 breaks down to 29.8GB.
    That being said, you can actually "lose" an insignificant portion of that space to metadata.
    It's all a bunch of marketing strategy, to be honest. It's just easier to say 16GB/32GB than to say the tedious number that it breaks down to in binary. Just like when you're buying internet service. They don't measure it in MB(megabytes)/second download speeds, because it looks too slow and the scale is too large. That's why they sell you your Mb(megabit)/second speed. When you think your 15mbps internet is SOOO fast, you're really only getting a peak of 1.875MBps. Make sense? I hope your mind can finally be at east that your phone is working just fine. Lol

  • Ever, decreasing...internet......speed.........

    My internet (Safari) keeps getting slower and slower. About every 3 months or so it takes a significant drop in speed. It now takes at least 20 seconds on average to load a single web page. However the download speeds have not decreased much at all. I checked the bandwidth and its about 1 mbps which is what its always been since I upgraded to broadband. I originally thought that maybe it was my wireless router going dead. Its a Linksys WT54G or something like that. But every now and then my airport card will fail. It will kick me off the network and when I try to get back on it will keep saying failed to connect and I know this isn't just because of my router because this also happens at ASU (my college). Does anyone else have this problem? Bad hardware? Possibly spyware or viruses (I know they aren't very common on Macs but I'm just throwing anything out)? Bad router? Or a combination of those? Somebody please help, this is almost as bad as dial up!

    It uses public DNS servers vs. the likely crummy ones your ISP provides.
    If you want better DNS, use the DNS servers from Opendns.com
    208.67.222.222
    208.67.220.220
    They filter out known phishing sites and will even correct typos like if you put in craigslist.com it will send it to craigslist.org for you.
    Note DNS takes your "apple.com" (or any web site) which means nothing to the internet and finds out the IP address for you and sends the traffic to the right IP address.
    Since you are using a router , to save doing these IP addresses in every computer that connects, put these in your router setup screen instead of what is there now which will be nothing. Then every computer benefits.
    Here is a link to see how to do it anywhere:
    http://www.opendns.com/start/
    Upper right on the page, just pick the operating system or device and they show you with pictures.
    ISP's pay bottom dollar I am convinced, for DNS.

  • Does Skype on Android ever sign out?

    I have been having a multitude of problems with Skype on both Android and Windows, I'll stick with Android here. System Specs:Samsung Galaxy SIII (Sprint)Model SPH-L710Stock ROMAndroid Version 4.1.2 Oftentimes I will receive messages marked as having been sent 'now' when in fact they were sent at a previous time and I already saw them on my Windows client.  It's a minor issue, but slightly frustrating when trying to keep a conversation in order. Signing out... Where to start?  Does Skype ever sign out properly on an Android handset?  I will very often receive notifications about missed messages when I know for a fact that I had signed out of Skype.  Here is a screenshot showing my notification bar when I am signed into Skype: The Skype icon is visible, and filled in.  Obviously I am signed in.  Ok, no problems here. Now here is a screenshot of of a message notification.  You might notice something is missing:
    That's right.  I am now receiving message notifications while I am not signed into Skype on my phone.  This is really annoying, and mildy creepy. There really is no rhyme or reason I can discern as to when or why I receive message notifications while being 'signed out'.  I get them after signing out.  I get them before signing in.  Hell, sometimes I get them as soon as I reboot my phone and I am definitely not signed in then. Another problem I have been having, but I don't have any screenshot for yet, is that Skype will tell me that either I or the person I am talking to has added other people to conversation who we've previously had group conversations with.  Neither I or the other party has actually done this though, and the person that is added doesn't seem to be receiving any of the messages.  Very weird buggy stuff for what is supposed to be a mature application. This really sucks for me because I've been trying like mad to find a decent unified messaging program since I use Android on the go, Windows at home and work, and my girlfriend has an iPhone.  Skype seemed like a great idea, I even plunked down for the premium subscription for the extra goodies (which I feel are a ripoff since most of them were free at some point, but that's another story for another day) - Apparently it isn't as great an idea as I thought it was. C'mon Microsoft.  It's 2013.  Instant messenger capabilities have been around for well over a decade now.  What's the issue?  Why is it so hard to find an application that will allow me to chat across different popular OSs without all sorts of funky issues?  That I pay for this just makes it all the more frustrating. Anyone else having problems like these?  Any remedies?

     Hi Alura, Father Christmas rewards little girls with patience and persistence, qualities he greatly admires - Merry (foot-washing) Christmas  I had a problem similar to yours with Skype 4.5.  Reverting to this more reliable older Skype 4.0.0.22082 version, resolved the problem for many of us with smart-phones.  Others, usually with tablets, reported that Skype 3.2.0.6673, better suited their needs.  If you have a smart-phone, tap the link of the former Skype, or the latter if you have a tablet.  If your first choice does not meet your needs, the other would be worth trying.   Before tapping the downloaded apk file to install the selected Skype, uninstall the current Skype, disable the Play Store “Auto-update apps” option, and enable the Android Settings (from) “Unknown sources” option.  Once installed, disable the “Unknown sources” option.  Be sure to try any future Skype release, indicated by a change of release date on the Google Play Store Skype “UPDATE” page.  If the new Skype is unsatisfactory, revert to the older Skype using the saved apk file.   You can choose an even earlier Skype version if you feel that this would be beneficial.  To date. I have not experienced any security problems with any of the above web links.  Please be sure to post another reply to let me know how you go with the installation.  I should be able to help you if you encounter difficulties.   If you have not already done so, you should create a good Android issue report here to help Skype improve future versions.  I am sure that a Private Message to Claudius, letting him know where your report is, would be a nice surprise, and really make his day    Regards, BGW.514 

  • Hashmap capacity planning

    Hi
    I am new to java forum,
    I am implementing java HashMap<String,String> hm= new HashMap<String,String>(capacity??,loadfactor??)
    Can someone help me to determine the formula for setting up capacity value and load factor value
    I am using Hashmap to store entries from range of 250K to 1.5 million records, Mostly I use feature of containsKey for each record to determine, if key is not present then add the (Key,Value)., Finally using Iterator to print all values stored in Hashmap.
    thanks in advance.

    My question is very specific to determining the capacity and load factor formula for known range of records tobe added in Hash map both with respect to memory utilisation and search speed and also best trade-off.
    Is there any formula/method?
    I have configured my jvm to use max and min 1GB memory to process application.

  • Does having a guest network decrease the power of the main network?

    I set up a guest network when I set up my Airport Extreme ... not sure why I did this exactly. I have moved into a larger home and now have some issues with the router reaching the entire unit. (It does actually cover it all ... but very weak in the farthest areas from the router.) Does the guest network take power away from the primary network. In other words, if I reset the router without the guest network, would I be better off?
    THANKS.

    When you enable the Guest network, the bandwidth is split between the Main and Guest networks, so performance wise, it would make sense to only use the Guest network feature when you really have "guests".
    Now, if you turn the Guest network off...whether you will actually "see" any improvement is open to question. Worth a try.
    To turn off the Guest Network....
    Open AirPort Utility - Click Manual Setup
    Click the Guest Network tab below the row of icons
    Remove the check mark next to "Enable Guest Network"
    Click Update to save the changes and the AirPort will restart in 25-30 seconds.
    If you need more wireless coverage, you might want to look at adding another AirPort Extreme or AirPort Express to "extend" the wireless signal.

  • Harddrive max capacity has decreased after reinstalling OSX

    I recently deleted my harddrive using the disk utility that came with my macbook. I then created a new partition in hopes of reinstalling the OS except that the maximum size availble for my partition is now 110gb when before it was at 120gb
    What happened? How do I fix this?
    Any help appreciated.

    Nothing really magical about it. I'm impressed you're impressed but there really isn't much about which to be impressed. Impressing, isn't it?
    Computers only can count in binary or Base 2. So on the computer 1 Gb is 1,024^3 or 1,073,741,824 bytes. Drive mfgrs. use Base 10 arithmetic so their 1 GB is 1,000,000,000. As you can see dividing the first by the second indicates a difference of just around 7%. This means that a 120 GB drive capacity in Base 10 translates to a 111 GB drive in Base 2. Either way the amount of storage is the same. The latter, however, more accurately reflects how the computer is keeping track. Under the hood it's always Base 2.

  • Why does firefox stop script ever since update to 3.6.8

    i go to some web sites IE jets.com and stop script sign comes up and firefox locks up, must shut down CP improperly

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).<br />
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]<br />
    <br />
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.<br />
    You can use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.<br />
    You have to close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

Maybe you are looking for

  • I Cannot get into iTunes

    I have just gotten my iPod today and downloaded iTunes from www.apple.com/ipod/start. After I downloaded the setup, I intalled iTunes. It worked till it got to the end. It had an error message that said the QuickTime was damaged and that something mu

  • Can I use a non-sinewave inverter to power my macbook

    Some power supplies can not tolerate the output of inverters that are not sine wave. I don't want to experiment  using my non- sinewave inverter and find out that the Magsaf power adapter smokes.

  • Can someone please tell me an easier way to split a clip?

    I just recently upgraded to iLife '09. I really miss the old iMovie where all you had to do to split a clip was press command-T, and then delete the part you don't want. Now it has the yellow box that you drag using the mouse and it just is not worki

  • Unknown Host sidhost (see /etc/hosts)

    Hi experts,     I'm facing a problem in maxdb please help us the issue Error: starting database instance ... Error! Connection failed to node devhost for database DEV: unknown host devhost (see /etc/hosts) Opening Database... Error! Connection failed

  • Not able to connect database remotely

    Hi All, I have an issue with remote connectivity to database EAIDEV. Application Team is not able to connect to EAIDEV database as jcaps_user. Here is the connection string : Server Name : 10.1.32.66 Port : 1622 User id : jcaps_user Coud any one plz