When does GC clean up

Hi,
Beginning in Java I'm still confused on when does GC clean up and under what conditions. Suppose following code where I increase the length of an int array:
     int[] tmp = foo;
     foo = new int[newCapacity];
     int i = 0;
     while (i < tmp.length)
          foo[i] = tmp[i++];Here foo is allocating new memory, but at that moment tmp is a pointer to the original value of foo. After the new memory allocation the copy is made.
Is there a possibility that the GC free the memory of foo because it dont know that there is another pointer pointed to it ?

Hi,
The GC is smarter than you apparantly think it is.Thanks, because I was worry about that. After a few
day's of Java I getting to like it, however I'm worry
about a GC thing that do things where I have no
control over it :( But you let me sleep on both of
my ears :)The whole point of garbage collection is that you, as a programmer, don't have to worry anymore about freeing memory that is not used by the program anymore. So stop worrying.
Ofcourse the GC will never cleanup any object that's still referenced. If it does, there's a bug in the GC, but that's not very likely.

Similar Messages

  • Keep iWork when doing a clean install?

    I am going to be doing a clean install of Mountain Lion when it comes out. I currently have iWork installed on my MBP. I installed it off a disk and not from the app store. I was wondering if there is a way to backup iWork so that when I do a clean install I can keep using them without having to pay again. Thanks for any help.

    IMHO I would classify that as a waste of time and a chance for more problems then it solves.
    Just backup and upgrade.
    From the sounds of your comments it doesn't sound like you are backing up at the currect time. To me that sounds like a much more serious problem thwen any of the one you are worried about.
    For the uograde a backup to DropBox would be worthless. If something goes wrong and your Mac can boot from the disk because of it, how are you going to get to DropBox to recover?
    Hence the reason I always create a bootable clone to recover my system with a simple reboot. At least my Mac is running on everything as it was before I started the upgrade until I can figure out what went wrong.
    Allan

  • My Macintosh HD vanished when doing a clean install.

    When I attempted to do a clean install of Yosemite, my Macintosh HD vanished when I tried to erase it and even with the help of an Apple tech over the phone We were not able to recover the Macintosh HD. I ended up having to bring the computer down to the Genius Bar to have them do it.
    I was told that it had to do with the fact that I have a Fusion drive as to my my Macintosh HD vanished when I attempted to erase it. Could this reasoning be true? If not then what could be causing the problem? How can I get around having this problem again should I need or desire to do a clean reinstall?
    Thanks.
    Dave

    IMHO I would classify that as a waste of time and a chance for more problems then it solves.
    Just backup and upgrade.
    From the sounds of your comments it doesn't sound like you are backing up at the currect time. To me that sounds like a much more serious problem thwen any of the one you are worried about.
    For the uograde a backup to DropBox would be worthless. If something goes wrong and your Mac can boot from the disk because of it, how are you going to get to DropBox to recover?
    Hence the reason I always create a bootable clone to recover my system with a simple reboot. At least my Mac is running on everything as it was before I started the upgrade until I can figure out what went wrong.
    Allan

  • Why does system suite pro 12 crash when running file cleaner is running while firefox is installed? If I uninstall firefox then system suite pro 12 won't crash.

    When I downloaded the newest version of firefox system suite pro 12 crashes when running file cleaner after I uninstall firefox system suite pro 12 doesn't crash. I have window 7 premium home edition 64 bit.

    You should know a few things before before getting started:
    1. Registry "cleaners" and "system optimizers" like SystemSuite are very unreliable, cause more problems then they propose to fix, have little to no benefit, and are somewhat of a scam. Running them on a system is almost guaranteeing a crash or hiccups somewhere along the process. running them is never a good idea. all you need is a good, simple, free anti-virus (like Microsoft Security Essentials), and use the built in Windows Utilities to clean and sped up your computer if needed.
    2. This is a Firefox forum, so if you are having a problem with SystemSuite, we might not be able to help you.
    I'll give you a few things you can do to see if this is just a Windows problem:
    Run all Windows Updates, install all needed service packs, etc.
    Update your graphics driver (Firefox uses your graphics card for some rendering, and an out of date graphics card driver can cause problems. [https://support.mozilla.org/en-US/kb/how-do-i-upgrade-my-graphics-drivers https://support.mozilla.org/en-US/kb/how-do-i-upgrade-my-graphics-drivers].
    Update all your plugins (Flash, Java, etc.): [http://www.mozilla.org/plugincheck/ http://www.mozilla.org/plugincheck/].
    Download and Install MalwareBytes Anti-Malware, run a full Scan. [http://www.malwarebytes.org/ http://www.malwarebytes.org/]. This helps check that there are no viruses on your computer causing issues. You can uninstall this program after you clean off any infections.
    Plus, I'd strongly recommend removing systemsuite and any other "optimizers" you might have.

  • When does a value help in Java webdynpro 2004s get created automatically

    HI All
    when does drop down value help get created automatically (without coding) in java webdynpro NW 2004s application for a view field mapped to a abap dictionary like currency(Domain:waers) having a value table  TCURC but has to be created for a field like UOM(Domain:meins) having a value table T006
    the only differnce I can see in the 2 domains in my current set up is, meins has a conversion routine & wears doesnt
    this is a question that applies to both java webdynpro & abap so please dont ask me to post it in another forum.
    Im sure some one has asked this question before. please guide me!!
    Thanks
    Prasad

    Question:
    If I start a java thread from the �main� thread of
    execution and that thread I just created finish�s
    executing its �run� method is that threads resources
    automatically clean up? Or do we have to do this
    clean up ourselves?Depends which resources you mean. There's nothing special about threads in that respect.
    Memory is automatically reclaimed when it is no longer reachable, so unless the run method set some member variables in some object that remains reachable after it completes, no worries there.
    Files, sockets, etc. remain open unless you close them.

  • Display shuts down when doing a system restore

    Presio CQ61-411M
    Windows 7
    Display shuts off when trying to do a system restore.
    When doing a system restore the display seems to shut off. I have tried many times, sometimes it stops at 3%, sometimes at 14% and sometimes before I can even start it. I have attached a second monitor and it goes off at the same time.
    I can no longer boot to windows since it started a system restore.
    I have tried to boot from a CD and also get a black screen. All lights on the keyboard are still on. It is like it goes into powersave mode. Light on HD is solid, doesn't make any noise.
    I am so frustrated! There was no power or display issues before I started. I was simply going to do a clean restore.

    Yes, if you have the music folder you still have your song files....the most important!
    But I would hate to lose my ratings and playlists.
    If you want your ratings and playlists from the ipod, itunes will NOT do it. You would have to download & install some other 3rd-party ipod manager. Such as mentioned here:
    http://www.ilounge.com/index.php/articles/comments/copying-music-from-ipod-to-co mputer/P2
    My advice for the future is to make frequent backups of the iTunes Library.itl file. About once a week, I put a copy on a USB stick Mor often if I've done lots of edits/added content. And ALWAYS before an itunes upgrade.

  • Adobe Première Pro CC crashes...when doing nothing!

    Please, i'm getting nervous about this: Brand new MacPro, 32GB RAM, Promise Pegasus Raid for Footage, Reinstall All ADOBE Stuff on clean/new drives, (No FCP7 or X installed), ans still I'm not so amazed by the speed and reactivity...But I'm now experiencing very frequent crashes when playing back sequences, difficulties to render a 4 minutes MXF with 3 filters on it, and surprisingly when doing nothing (project rendered, saved) or reading an email with première in background... !
    Check the kind of error message I got this morning... [cloudroom/releases/2014.09/PremierePro/Mezzanine/Src/Import.cpp-589]
    Should I go back to FCP 7 ?    ;-)
    Thanks for your help !
    JFT
    Model Name: Mac Pro                                      Model Identifier: MacPro6,1
      Processor Name: 12-Core Intel Xeon E5       Processor Speed: 2,7 GH
      Number of Processors: 1                              Total Number of Cores: 12
      L2 Cache (per Core): 256 KB                          L3 Cache: 30 MB
      Memory: 32 GB                                             Boot ROM Version: MP61.0116.B11
      SMC Version (system): 2.20f18                     Illumination Version: 1.4a6

    >and encore i don't have
    CS5-thru-CC PPro/Encore tutorial list http://forums.adobe.com/thread/1448923 will help
    The bottom section of the link above has several Adobe links, and other information, on downloading Premiere Pro CS6 and the bundled Encore CS6, and the TWO ADDED downloads for the Encore library content, to author a DVD or BluRay... and the tutorial list includes learning how to use Encore... pay particular attention to the picture in reply 3 at this link - https://forums.adobe.com/thread/1516173 (picture first posted by Ann Bens and reposted by Stan Jones)

  • Does a clean install of lion help with problems?

    Anybody who has had the litany of problems associated with lion tried an absolute clean install to see if that helps?

    But It would be nice if just safari, mail, and the finder would work without giving me the spinning wheel at this time.
    How much RAM do you have?  Also, open Activity Monitor, click the System Memory tab and look at your page ins and page outs.  If page outs is more than 1/10 of the page ins, you need more RAM.  I myself was having some beach balls when doing certain demanding things (playing games, using Aperture, etc), and noticed that these values were darn close to equal.  So I upgraded from 4 GB to 8 GB of RAM and all is now good, no matter what I'm doing.
    My timemachine backups failed a few days ago, I lost my copy of a working SL backup at that time, so much for diligence.
    Yeah, one backup is not nearly enough.  I can't tell you how many times I've seen people who didn't realize their backups were on their way out until the moment they actually needed them, and then it's too late.  Keep one Time Machine backup in the future, and at least one other backup with something like Carbon Copy Cloner.
    I do think that it is important to know if others have had success with clean installs because I need to know if it is worth my while. Did you do a clean install?
    But what I'm telling you is that it doesn't matter what others say.  Unless you know that the cause of their problems is exactly the same as the cause of your problems, what they say is irrelevant.  There are plenty of people here who have been helped by clean installs, but if all you need is more RAM, a clean install will be a waste of your time.
    I did not do a clean install, I just installed Lion right on top of Snow Leopard.  And except for my memory issues, which were overall nonexistent except when (and after) running certain apps, it's been a pretty smooth transition.  But again, that has no bearing on your situation, except to tell you there's nothing inherently problematic about an upgrade install.

  • My iphone 5 keeps crashing all the time and has a delay of about 3 seconds when doing anything on it i did a factory restore on it but it didnt fix the problem

    my iphone 5 keeps crashing all the time and has a delay of about 3 seconds when doing anything on it i did a factory restore on it but it didnt fix the problem i went to optus to see if they could help me as my phone is through them but they knew nothing i need help please my phone is only 8 months old

    Plug the device into a wall outlet and leave it for about 20 minutes. If it has not powered on at that point try a reset by pressing and holding the home and power buttons for about 15 seconds until the white Apple logo appears.

  • I am currently using Lightroom 5.6 and operating on a Mac with OSX Ver 10.9.5. I am receiving an error problem when doing the following -  I am exporting selected photos from a particular Catalogue saved on Drive 1 to a folder created on another Drive whe

    Hi, I am having a little trouble with exporting images to another drive and Catalogue and need some help if anyone can give me some advice
    I am currently using Lightroom 5.6 and operating on a Mac with OSX Ver 10.9.5.
    I am receiving an error problem when doing the following -
    I am exporting selected photos from a particular Catalogue saved on Drive 1 to a folder created on another Drive where a Lightroom Catalogue has been created. In this Catalogue I have arranged for the images once exported to be moved to a different folder - I used the Auto Import process under the File dialogue box.
    When processing the Export I receive an error message for each of the images being exported indicating the following -
    Heading Import Results
    Some import operations were not performed
    Could not move a file to requested location. (1)
    then a description of the image with file name
    Box Save As                                  Box  OK
    If I click the OK button to each image I can then go to the other Catalogue and all images are then transferred to the file as required.
    To click the OK button each time is time consuming, possibly I have missed an action or maybe you can advise an alternative method to save the time in actioning this process.
    Thanks if you can can help out.

    Thank You, but this is a gong show. Why is something that is so important to us all so very, very difficult to do?

  • Error in pricing when doing sourcing in EBP 4.0

    Hello,
    We're experiencing random errors when doing sourcing in EBP 4.0. The shopping carts don't seem to have any similarities that could launch the error. There has been few cases when the same error has occured when user is creating a shopping cart.
    The problem occures when doing sourcing and the shopping cart is either being held or a PO is created. The error creates dump in ST22, "UNCAUGHT_EXCEPTION". This is somehow related to pricing and we have checked note 673372 and ran report BBP_CND_CUSTOMIZING_CHECK, all OK. IPC is running the same SP level as SRM, SP level 10.
    We have already created an OSS about this, but as this is completely random we haven't been able to reproduce the error and no solution has been found.
    Here's some data from ST22:
    Transaction......... "BBPSOCO01 "             
    Program............. "SAPLBBP_PDH"            
    Screen.............. "SAPLBBP_SOCO_UI_ITS 2000"
    The termination occurred in the ABAP program "SAPLBBP_PDH" in "BBP_PD_ABORT"
    The main program was "SAPLBBP_SOCO_UI_ITS ".                                                                               
    The termination occurred in line 69 of the source code of the (Include)   
    program "LBBP_PDHU08"                                                    
    of the source code of program "LBBP_PDHU08" (when calling the editor 690).
    000600   * get the messages from the application log    
    000610     TRY.                                         
    000620         CALL FUNCTION 'BBP_PD_LOG_GET_MESSAGES'  
    000630           TABLES                                 
    000640             E_MESSAGES = LT_MESSAGES.            
    000650       CATCH CX_BBP_PD_ABORT.                     
    000660         REFRESH LT_MESSAGES.                     
    000670     ENDTRY.                                      
    000680                                                  
    >     RAISE EXCEPTION TYPE CX_BBP_PD_ABORT EXPORTING
    Thanks already in advance!
    -Jussi

    Hi
    Please refer to following SAP Notes:
    Note 860935 - pricing customizing exits are missing
    Note 673372 - Short dumps UNCAUGHT_EXCEPTION in SRM 3.0, 4.0, and 5.0
    Also try to implement the latest IPC patches following the instructions from note 880749, then restart the VMC. It worked for us, after trying many things with no luck.
    Alternatively, try this as well. There must be some problem with VMC. Most probably java connection problem. Please execute program RSVMCRT_HEALTH_CHECK in SE38 transaction. You should see green for all 4 messages in the result. Please contact your basis consultant and refer notes 854170 (and 844817)
    <u>Other related OSS notes.</u>
    Note 1024374 - Unexpected pricing error for pricing irrelevant item
    Note 992259 - NullPointerException in Command GetFilteredCsticsAndValues
    Note 860935 - pricing customizing exits are missing
    Note 673372 - Short dumps UNCAUGHT_EXCEPTION in SRM 3.0, 4.0, and 5.0
    Note 854170 - Activating the component "VM Container"
    Note 593109 - Short dumps UNCAUGHT_EXCEPTION in SRM 2.0 (EBP 3.5)
    Note 880749 - Patching of VMC based AP 7.00 engines
    Note 854170 - Activating the component "VM Container"
    Note 844816 - Information for Upgrade from IPC 4.0 to SAP AP 7.00
    Hope this will help.
    Please award points if helpful.
    Regards,
    -Atul

  • What if you tried doing the clean up on your mp3 player and it don't work in rescue m

    i tried doing a clean up cause my mp3 player is in rescue mode and it don't do anything. i've never formatted anything in my life so i'm a little nervous about doing that. is there some keys you hold to get the clean up to work. i have a zen xtra mp3 player. it is my husbands. so if anyone can help me out there please e-mail me at [email protected] and put in the subject line rescue mode help. tracy

    and how do i do that i've never done that before?tracy

  • No Data when doing multiple selection of sub-brand in the cube

    Hey everyone.
    I am having a very strange situation.
    No Data when doing multiple selection cube.
    The thing is that the situation is created only in the transition between the servers, who have a different Build but both of them are SQL 2008R2 servers.
    The Build of one of them is 10.50.2789.0 and the other one is 10.50.4000.0 (SP2).
    The other properties of the cube are the same, it's Not possible to retrieve data from the cube on the server with the "SP2 when we  the slicing is at the level of sub-brand and removed even one item  mean we passed a multiple selection ,
    This is possible only if we connect the cube as Admin .
    While the server with the older "Build" the problem to perform the above operation when connected as a user not exist.
    What can cause this problem,and how can we fix it?
    thank's a lot.

    Hi Doron2Bull,
    According to your description, there are two servers in your scenario, and you cannot retrieve data from one of the cube, right? Are there any differences between the two cubes on different? You can import the database on the server into BIDS and explore
    Data on the fact table on the Data Source View to check if there are any data. If we can see the data when we do Explore Data on the fact table on the Data Source View (DSV), but when we browse the cube here is no data. Then there are many possibilities for
    this issue.
    On the cube's Dimension Usage, the relationship between this measure group and the dimension is not correctly defined.
    On the relational database, the dimensional key column on the fact table does not correspond to the key column on dimension table.
    There is a Default Member on another dimension, and there is no fact table row that satisfy this condition.
    If I have anything misunderstood, please point it out.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Firefox 5 apparrently changed a Windows setting, now I have artifacts remaining on top of my desktop when doing things like selecting a file and doing an open with selection.

    Ever since I my system updated to Firefox 5 I now have issues such as:
    Want to open a file such as a doc in Wordpad instead of Word (for speed and simplicity), I right click on the file and select open with Wordpad...the Wordpad and it's icon now stay on the desktop, on top of anything else. This happens when doing any open as selections. This did not happen before Firefox 5......there must be an overriding code confliction. Am using XP Home Premium.

    Hi Steve1904,
    So you have use the backup and Restore to restore your files from Windows XP to Windows 7 directly?
    This should be considered not work.
    If you would like to transfer files between Windows XP and Windows 7, you need another tool called Windows Easy Transfer.
    See the article below if you would like to upgrade from Windows XP to Windows 7:
    Upgrading from Windows XP to Windows 7
    If possible, follow the steps there, then things should be OK.
    Best regards
    Michael Shao
    TechNet Community Support

  • How do I import my address book after doing a clean install of Leopard?

    I just finished doing a clean install of Leopard and I realized that I forgot to export an Address book archive before erasing my hard drive. I still have all the Address Book files stored in Application Support in my Library (on my backup hard drive) but I don't know how to get those files into Address Book. Whenever I try the different import options they are all grayed out.
    I also have the Address Book files stored on my iPod Touch but syncing with my Touch doesn't seem to bring them into my computer. Is there anything I can do at this point besides entering them in one at a time?! Copying and pasting the files from the backup to the current folder doesn't seem to do any good either. It will tell me that the files I am trying to write over and in use. It says this even after I close Address Book.

    Ok, I got is to work by selecting the folder itself and copying it over. Aparently it does work if you open the folder, select all the contents and then paste it. I didn't think it would matter which way you did it.

Maybe you are looking for