Reachability with a strict reading of the JLS

Hi,
I have a small question, please tell me what you think.
Given the following codepublic class ReachableTest {
     public static void main (String[] args) {
          ExpensiveObject o = new ExpensiveObject ();
          byte[][] arr = new byte[100][];
          for (int i = 0; i < 100; i++) {
               arr[i] = new byte[1000000];
class ExpensiveObject {
     private final byte[] expensive = new byte[100000000];
     @Override
     public String toString () {
          return expensive.toString ();
}at which point is the ExpensiveObject eligible for garbage collection? Running the example with java -Xmx100m ReachableTest gives an OutOfMemoryError as the Sun JVM won't collect the variable o before the end of the method. My question is, given the following note in the JLS, could a conformant JVM collect the ExpensiveObject before the loop begins?
"A reachable object is any object that can be accessed in any potential continuing computation from any live thread. Optimizing transformations of a program can be designed that reduce the number of objects that are reachable to be less than those which would naively be considered reachable. For example, a compiler or code generator may choose to set a variable or parameter that will no longer be used to null to cause the storage for such an object to be potentially reclaimable sooner." http://java.sun.com/docs/books/jls/third_edition/html/execution.html#44762

My question
is, given the following note in the JLS, could a
conformant JVM collect the ExpensiveObject before the
loop begins?Yes. Indeed, with the code as given, a comformant JVM could conceivably not bother to instantiate ExpensiveObject in the first place, since its constructor has no side effects, and the reference is never used.
The new Java Memory Model, which is part of Java 1.5, somewhat changes the rules about reachability, particularly as regards references held in static fields, but it wouldn't affect your example.
Sylvia.

Similar Messages

  • Windows Easy Transfer (WET) Issues with External Hard Drive - "Can't read from the source file or disk"

    I work for Office Depot, in the tech department. Basically, one of our associates was supposed to do a data backup, and re-install Windows 7, then transfer the files back. He used Windows Easy Transfer and compacted everything into a 163 GB file. 
    Now comes the hard part. When we try to put it back on his computer ((drag-and-drop to the desktop) which has been wiped back to factory settings using the recovery partition), it stops at 79.5 GB remaining (you know how it doesn't give you a % of completion,
    it just shows how many GB are remaining) and then says "Can't read from the source file or disk" and gives you an option to try again, or cancel. It gets hung up on the same point each time.
    Normally, this wouldn't be a huge issue, but the contents on the drive are his wife's architect blueprints and interior design stuff, along with wedding photos, etc, which are the only copies they have. On top of those, they have court documents and other
    important files that we are unable to access now.
    I wasn't involved with this transfer, so I'm trying to clean up the mess as best I can. I remembered that the customer's wife was Russian, and had some files typed with a Russian keyboard, so on and so forth. I wonder if that's the issue? If not, I really
    have no idea how to manually extract things from a ".mig" file, or how to diagnose what area is potentially corrupted.
    In light of this situation, we tried using "Recuva" to recover the files post-wipe, but everything was corrupted or unable to be opened, and it also extracted and recovered all of the "useless" photos, such as the skype logos, up and
    down arrows for browsers, etc (it was 160,000+ photos).
    Trying to avoid a potential lawsuit, unhappy customer, and costing the company lots of money to see if professionals can get into this external hard drive.
    Other relevant information:
    We used a Toshiba 500 GB (465 GB) external hard drive.
    Customer's computer is an HP Pavilion P6000 Series (Model No. p6520y) running Windows 7 Home Premium 64-bit Service Pack 1.
    Any other information that is needed can be provided, thanks in advance, and hopefully we can find a solution to this issue quickly!
    -John

    I think there's a lack of understanding somewhere.
    "If you even can't start the process, please unplug it from your new PC. Then head back to your new computer and plug
    the external drive back in to your new computer. "
    Unplug from new, head back to new, plug it back in? That doesn't make much sense! Haha.
    I knew what you meant though, somewhat. When I search through the drives after clicking yes (Has windows easy transfer
    already saved your files blah blah blah) I click on the transfer file and it says "Windows Easy Transfer could not open the file".
    Rather than drag-and-drop the file to the desktop, I now tried to double-click on the file itself while it was plugged
    into the computer. It opened, and it started transferring until it was about 70% completed, and then an error popped up saying "WET can't open the easy transfer file, make sure your USB device is plugged in or check your internet connection". 
    I checked, and the USB hard drive's light wasn't on. Now, I unplug it and plug it back in, and the light comes back on,
    so I click Retry, and it resets the bar back to nothing and says "Transfer time: 1 minute".
    Rather than continue trying, I clicked "Cancel" instead of Retry, and it says "Your transfer did not complete successfully."
    It says to click "view report" for more information, but there's no "view report button".
    At the moment, I am scanning the External Drive for bad sectors using the check disk tool in properties. It's frozen
    at "0 USN bytes processed".

  • Who worked with ICS' Model 4896 GPIB? I can not count the data from the module. Can prompt as it to make. It is desirable with examples (data read-out from the module and data transmission between channels. It is in advance grateful.

    I can not count the data from the module. Can prompt as it to make. It is desirable with examples (data read-out from the module and data transmission between channels. It is in advance grateful.

    Hello. Most of the engineers in developer exchange are more familiar
    with NI products. Contacting ICS for technical support is a better
    course of action.

  • How do I display the web address with Adobe PDF Reader 10.1.1 & IE 9 x64?

    Until a week ago, I was using IE 9 32-bit version together with Adobe PDF Reader 10.1.1.   When I would try to open a PDF file from within the browser, it would and the Web Address would continue to display at the top of the window while browing the PDF document. I could then continue using IE 9 and move on to other pages and etc...
    Now, I have swtiched to using the IE 9 64-bit version. What happens now is that when I enter an address in the web browser and it's a direct link to a PDF file example: https://www.technicalindicatorindex.com/newsletter/bpdf/TII_Newsletter _1686a_10.11.11_7055475115.pdf ), it opens up with no problems, but I no longer see the IE 9 Web Address shown anywhere. So in essence, that page becomes a Adobe PDF program window and I loose my IE 9 access. I guess the PDF files are no longer displayed within the browser (althought I have it check ON).
    Am I missing something?

    I did write there, but no replies
    I guess that with Adobe Reader 10.1.1 running with IE 9.x in x64 bit mode, you cannot open the PDF within explorer, as it does it outside it as a separate Window?
    Correct?

  • Hi I've a big problem with adobe acrobat reader XI pro and I hope you can help me. The problem is; when I past copied text from some pdf books (not all of them) it past symbols only! wherever I past it! and even if I coped that text from another pdf reade

    Hi
    I've a big problem with adobe acrobat reader XI pro and I hope you can help me.
    The problem is; when I past copied text from some pdf books (not all of them) it past symbols only! wherever I past it! and even if I coped that text from another pdf reader (adobe pdf reader, internet browsers, ...etc.).
    This problem started to happen since yesterday when I installed adobe acrobat reader XI pro to try it before I buy it, and before that when I was using the free adobe pdf reader I was totally able to copy any text from any pdf and past it anywhere with nothing wrong.
    What can I do?
    thank you a lot.

    There is no product called Adobe Acrobat Reader Pro. There is
    - Adobe Acrobat Pro ($$)
    - Adobe Reader (free)
    Which do you have? And are you a programmer?

  • I have huge lag with Safari's Reading List using a rMBP. I have probably 80 articles saved, which is likely the cause of the lag. Is there any way to export that list of articles so as to be able to delete them from Reading List but still have a record?

    I have huge lag with Safari's Reading List using a rMBP. I have probably 80 articles saved, which is likely the cause of the lag. Is there any way to export that list of articles so as to be able to delete them from Reading List but still have a record of the articles I intend to read?

    I'm currently dealing with this issue myself, except that my rMBP has NO articles in the reading list.  It's a brand new rMBP too, purchased just this week, with the 2.6 Ghz Processor & 16GB of RAM.
    Let's see what we can find.  I may just take it back to the Apple Store.

  • After updating I ended up with 4 icons on my desktop - I cannot delete any of them. The error message reads; "Cannot read from the source file or disk".

    I updated from the original version to 6.0.1 and when I re-started FF there were 4 icons on my desktop. I managed to delete one of them, but I cannot delete the other two - to leave me with just one.
    I get the error message of "Cannot delete file: Cannot read from the source fie or disk".

    Here's the meaning of the error that you received.
    "An error has occurred. ERROR :10-FC06-0002" -- may be caused by damaged recovery media or faulty hard drive"
    Possible that the problem is on the recovery also.
    Hope this helps.

  • I have an older version of Adobe Digital Editions (around 3 years old) and was very happy with it.  Then I had problems with my Kobo Reader and asked a friend who works in IT to assist. She could not fix the Kobo but she messed up my Addobe. She downloade

    I have an older version of Adobe Digital Editions (around 3 years old) and was very happy with it.
    Then I had problems with my Kobo Reader and asked a friend who works in IT to assist. She could not fix the Kobo but she messed up my Addobe. She downloaded version three and I have an account and a password - was not able to transfer my books from my reader to version three (and I don't like the lay-out - I would prefer to stay with the old version as I also loose all my download date info..)
    But all the books I have bought over the last three years are in the old Adobe Digital and I cannot access them any more. When I use it I get the message "that the document is licensed to a different account. I can't even open the books on my computer.
    When I go to my Kobo library, I cannot also not open my books and get the message "this doc is protected by adobe digital rights management and is not currently authorized for use with your adobe. please sign in with your authorized adobe id and try again"
    I believe the problem is that I do not seem to have a digital id for my old adobe or that the Kobo is not in sync with it anymore.
    can you please help me - going on vacation in three days and cannot go without books.

    Please authorize ADE 3 with same credentials that you used with older version of ADE

  • HT4759 Is it true that when setting up devices with the find my phone app you must use the same account for ICloud ? If so how do I delete a current account to make it read as the other ICloud accounts?

    I'm setting up my devices with the find my phone app. I have accomplished setting up 2 devices. The third I can't setup because I can't change the iCloud account.
    My understanding from reading that the iCloud accounts must use the same name on all devices. How do I change that account in my phone settings?

    You don't have to use the same iCloud account in order to track all your devices.  You just have to sign into the iCloud account being used on the device you are trying to track in order to track it.  When you sign in on icloud.com and open Find My iPhone, you will see all the devices with Find My iPhone enabled that are using the account you signed in with.  To track a device using a different account, simply sign out, then sign back in using the ID the new device is using.
    The Find My iPhone app works the same way.  It will display devices based on the iCloud account you sign in with on the app.  To track a device using a different account, sign out, then sign back in with the iCloud ID that the new device is using.

  • I would like to use slideshow in lightroom to export my video as a full screen 1920x1080 video with text overlays.  I am using text overlay in lightroom as it reads from the metadata that is easy for me to input in the library screen.  When i export from

    I would like to use slideshow in lightroom to export my video as a full screen 1920x1080 video with text overlays.  I am using text overlay in lightroom as it reads from the metadata that is easy for me to input in the library screen.  When i export from lightroom slideshow and choose the 1920x1080 resolution the end product is a very small video in the middle of a black background.  i have double checked and do not have any borders turned on.  Another option would be to export from the library but lr mogrify does not seem to put text overlays on video either.  Any input would be welcome.

    I dont understand anything you said in your post.
    Do you have a specific question about video production?
    The forums are for individual technical or creative issues that users have with video production. I am sur someone will be able to help you, but and to get a response it is best to ask a specific question.
    Is this about a technical problem you have or something about setting up a web site? If its the latter this is the wrong forum.

  • After Upgrading to 10.6.8 my aperture app starts but hangs trying to read the Lib. I removed the old lib and start with new. but still have the problem. 10.6.8 also made my Shark FX7 do the same thing. Any Ideas? Thanks

    After Upgrading to 10.6.8 my aperture app starts but hangs trying to read the Lib. I removed the old lib and start with new. but still have the problem. 10.6.8 also made my Shark FX7 do the same thing. Any Ideas? Thanks

    Verifying volume “Macintosh HD”
    Performing live verification.
    Checking Journaled HFS Plus volume.
    Checking extents overflow file.
    Checking catalog file.
    Checking multi-linked files.
    Checking catalog hierarchy.
    Checking extended attributes file.
    Checking volume bitmap.
    Checking volume information.
    The volume Macintosh HD appears to be OK.

  • I have a photo of an ice surface and another of a flower. Now I want to create a merged photo with the flower lying under the ice. I understand that I shall use the function "Layer" and have even read in the manual and looked on a video, but that informat

    I have a photo of an ice surface and another of a flower. Now I want to create a merged photo with the flower lying under the ice. I understand that I shall use the function "Layer" and have even read in the manual and looked on a video, but that information is not sufficiently detailed for me. I have tried several options, but I come now way. Generally it seems that your information is only for the ones who can, not for the people who can´t although it is we who really need to learn. Please give me a step by step (click by click) information on how I can get the ice above the flower and then make the ice partly transparent so the flower is seen underneath. Please send me an e-mail Erik Solbu [email protected]

    Open a new document big enough for your image. Then additional open your ice and flower image as well. Copy each and paste it into your blank document. They will be placed on their own separate layers.
    Make sure in your layers panel. (Bottom right) the ice is above the flower, by dragging it in place. In that same layers panel click the ice layer to select in and find the opacity meter above. Drag to the left until you get the effect you desire.

  • When I open an encryted pdf file in my Hp  Slate 7 voice Tab it was unable to open the pdf file.Tje same file was opening with other pdf reader software.Kindly Help.

    When I open an encryted pdf file in my Hp  Slate 7 voice Tab it was unable to open the pdf file.Tje same file was opening with other pdf reader software.Kindly Help.
    [spam link removed]

    Could you please send the pdf to [email protected] so that we may investigate the issue?
    Thanks,
    Adobe Reader Team

  • Polymorphic read not working with an AI-100, when the VI is embedded on the controller?

    I have a cFP-2100 and I am trying to set up a read VI for a
    cFP-AI-100.  I have built a VI and run it on my computer and
    deployed to the target and in both cases the code runs fine. 
    However, when I build a source distribution, load everything into the
    root/ni-rt/startup directory and try t o tun the VI the read fails to
    work.  I have added the totken RTTarget.StartupVIs with the path
    to my VI that I want to run on startup.  A write (to a cFP-DO-400
    and to the LEDs on the cFP-2100) works fine.  Everything has been
    setup in MAX properly (I think) but I am assuming that there is a check
    box, option or property somewhere that needs to be enabled.  
    Please see the attached block diagram.  Does anyone have any
    insight into this problem?
    Thanks
    Scott

    A problem may be that the
    resource/device/item names that are configured in MAX, and/or the IAK file name
    may be different on the target so the EXE may be trying to access a non-existent
    item.
    Also, try updating the FieldPoint
    Driver, using the following options:
    Product Line: Distributed I/O –
    FieldPoint
    Software: NI-FieldPoint
    Software Version: 5.0.1
    Operating System: Select your operating
    system.
    After doing this, make sure to update
    your FieldPoint driver on the target as well.
    Please try to create an example that
    only reads from the AI-100 module and see if you are able to get any data from
    that.  Run it both as a VI and as an
    executable.  Also, can you please clarify
    what you mean by fails to work?  Do you
    mean that the data is incorrect, nothing is being read, the values are all
    zero? 
    Please let me know what you find.  Best of luck on your application, and have a
    great day!!
    Regards,
    Ching P.
    DAQ and Academic Hardware R&D
    National Instruments

  • How to read data with different XML schemas within the single connection?

    I have Oracle 11g database
    I access it through jdbc:oracle:thin, version 11.2.0.3, same as xdb.
    I have several tables, each has one XMLType column, all schema-based.
    There are three different XML schemata registered in the DB
    I may need to read the XML data from several tables.
    If all the XMLTypes have the same XML schema ,there is no problem,
    If the schemata are different, the second read throws BindXMLException.
    If I reset the connection between the reads of the XMLType column with different schemata, it works.
    The question is: how can I configure the driver, or the connection to be able to read the data with different XML schemata without resetting the connection (which is expensive).
    The code to get the XMLType data is textbook implementation:
    1   ResultSet resultSet = statement.executeQuery( sql ) ;
    2   String result = null ;
    3    while(resultSet.next()) {
    4   SQLXML sqlxml = resultSet.getSQLXML(1) ;
    5   result = sqlxml.getString() ;
    6   sqlxml.free();
    7   }
    8   resultSet.close();
    9    return result ;

    It turns out, that I needed to serialize the XML on the server and read it as Blob. Like this:
    1    final Statement statement = connection.createStatement() ;
    2    final String sql = String.format("select xmlserialize(content xml_content_column as blob encoding 'UTF-8') from %s where key='%s'", table, key ) ;
    3   ResultSet resultSet = statement.executeQuery( sql ) ;
    4   String result = null ;
    5    while(resultSet.next()) {
    6   Blob blob = resultSet.getBlob( 1 );
    7   InputStream inputStream = blob.getBinaryStream();
    8   result = new Scanner( inputStream ).useDelimiter( "\\A" ).next();
    9   inputStream.close();
    10   blob.free();
    11   }
    12   resultSet.close();
    13   statement.close();
    14
    15   System.out.println( result );
    16    return result ;
    17
    Then it works. Still, can't get it work with XMLType in resultset.On the client unwrapping XML blows up when trying to switch to different XML schema. JDBC/XDB problem?

Maybe you are looking for

  • After Effects CC (2014) not updating (Mac)

    Having issues trying to update After Effects 2014 as mentioned in the title. Gets about 50% and then quits. Here is a log file in case anyone can she light on this. 10/20/14 10:18:28:310 | [INFO] |  | OOBE | DE |  |  |  | 531331 | *=*=*=*=*=*=*=*=*=*

  • Regarding OM Infotype Enhancement

    Hi Friends, I got a requirement to enhance a OM Infotype HRP5122 and HRP5126. Please give me a hint to do the enhancement. Thanks, Anil.G

  • Error cpoc149 - PI Sheet

    Hi, I'm trying to test PI Sheets functionalities on ECC 6.0 and now I'm getting the following error when I create the control recipe: Internal error while parsing/generating; Processing is terminated Message no. CPOC149 Have any of you seen this mess

  • Exception regarding DB

    hi, i got the below exception which i am getting when i try to get db connection. ORA-06550 line1,column12 PLS-00904:insufficient privilege to access object. APPS.JDR_MDS_INTERNAL PL/SQL:Statement ignored can you please any one give me the solution f

  • Speed Up Your Phone

    Hey guys, since I know a little trick to speed up your phone a bit. I found this trick on the internet some time ago, don't know exactually where. Anyway here it is: Open up your phone's menu and go to LOG. (this utility keeps track of your recent ca