Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6359560

(fs) File.deleteOnExit() doesn't work when MappedByteBuffer exists (win)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 5.0u6
    • core-libs
    • x86
    • windows_xp

      1. create a file by calling File.createNewFile().
      2. mark the file, File.deleteOnExit()
      3. write something in the file, open it for reading using MappedByteBuffer mapping.
      4. close everything, dereference the mapped buffer (that one cannot be directly closed)

      5. Error -> depending on how fast you exit the program, the file will or will not be deleted.

      I would expect the mapped buffer to be unmapped on shutdown and the file to be released.

      Our usecase in netbeans IDE is:
      the output window is memory mapped for reading, the output keeps the output tabs open until the user closes them or until he/she closes the whole IDE.
      This is Windows only problem it seems to work correctly on other platforms.

            alanb Alan Bateman
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: