File Copy Operation

Hi,
I am developing a desktop application that needs a file copying feature. I basically need to copy mp3 files from a PC drive to another external drive that is connected to my PC through a USB Port...this external device is USB2.0 compatible. Currently I have coded a simple filecopy thread using Buffered Reader/Writer. The operation for a 6 MB file takes about 6.3 secs, but the same operation in C took me about 1.4 seconds. I am wondering if this is the best speed I can get using Java...and if so should I switch to using C and writing a JNI wrapper around the C function.
Please suggest me on a suitable course of action.

I have been investigating the use of buffered streams
in network transfers (bigger files than mp3s though)
and i have noticed that the size of the buffer as in
byte [] buf = new byte[8096];makes very little difference, Yeah it is fun benchmarking.........what i observe is that as we increase the array size the time taken also reduces but then there comes a point (of inflexion?)at which u get a best speed and beyond that any increase in the array size does not make any difference...has anyone observed such a thing??
Anyway I equalled/beat the C code...and I am just happy for that!!!!!

Similar Messages

  • Finder Consumes 90% CPU at file copy operation

    I am trying to copy a large number of files (over 100,000) in a bunch of folders, from internal HDD to external USB one. The files are mostly images. Finder starts at a canter, with about 20 Mb/sec copy speed, and only around 5% CPU usage (NOTE - I have disabled "show icons preview" option in FInder, which is a common CPU hog in multiple image files copy operations)
    After a while the CPU usage goes up to 80-90%, and the file copy operation slows down to 1-2 Mb/Sec.
    I am at a loss as to what might be causing it! Any suggestions?

    files are relatively small - from 100 kb to 3-5 Mb each, and the issue is - the slowdown occurs quite some time after the beginning of the file copy operation - for several minutes it goes OK, with Finder consuming only below 10% CPU, and copy speed 20Mb/sec. It is only AFTER SOME TIME that the issue starts to happen - and the files being copied are THE SAME TYPE FILES. and suddenly the speed drops to 1-2 Mb/sec, and CPU usage jumps up. The result - it takes ages to copy and overloads CPU.
    So it must be a bug somewhere.
    I cannot use Firewire, since the external drive is USB 2.0 which when it works as its supposed to (transfer speed 20-30 Mb/sec) is quite acceptable to me.
    Surely I am trying to copy smaller batches of files - but that is a workaround, not a solution!

  • Network speed affected by large file copy operations. Also, why intermittent network outages?

    Hi
    I have a couple of issues on our company network.
    The first is thate a single large file copy imapcts the entire network and dramatically reduces network speed and the second is that there are periodic outages where file open/close/save operations may appear to hang, and also where programs that rely on
    network connectivity e.g. email, appear to hang. It is as though the PC loses it's connection to the network, but the status of the network icon does not change. For the second issue if we wait the program will respond but the wait period can be up to 1min.
    The downside of this is that this affects Access databases on our server so that when an 'outage' occurs the Access client cannot recover and hangs permamnently.
    We have a Windows Active Directory domain that comprises Windows 2003 R2 (soon to be decommissioned), Windows Server 2008 Standard and Windows Server 2012 R2 Standard domain controllers. There are two member servers: A file server running Windows 2008 Storage
    Server and a remote access server (which also runs WSUS) running Windows Server 2012 Standard. The clients comprise about 35 Win7 PC's and 1 Vista PC.
    When I copy or move a large file from the 2008 Storage Server to my Win7 client other staff experience massive slowdowns when accessing the network. Recently I was moving several files from the Storage Server to my local drive. The files comprised pairs
    (e.g. folo76t5.pmm and folo76t5.pmi), one of which is less than 1MB and the other varies between 1.5 - 1.9GB. I was moving two files at a time so the total file size for each operation was just under 2GB.
    While the file move operation was taking place a colleague was trying to open a 36k Excel file. After waiting 3mins he asked me for help. I did some tests and noticed that when I was not copying large files he could open the Excel file immediately. When
    I started copying more data from the Storage Server to my local drive it took several minutes before his PC could open the Excel file.
    I also noticed on my Win7 client that our email client (Pegasus Mail), which was the only application I had open at the time would hang when the move operation was started and it would take at least a minute for it to start responding.
    Ordinarlily we work with many files
    Anyone have any suggestions, please? This is something that is affecting all clients. I can't carry out file maintenance on large files during normal work hours if network speed is going to be so badly impacted.
    I'm still working on the intermittent network outages (the second issue), but if anyone has any suggestions about what may be causing this I would be grateful if you could share them.
    Thanks

    What have you checked for resource usage during one of these copies of a large file?
    At a minimum I would check Task Manager>Resource Monitor.  In particular check the disk and network usage.  Also, look at RAM and CPU while the copy is taking place.
    What RAID level is there on the file server?
    There are many possible areas that could be causing your problem(s).  And it could be more than one thing.  Start by checking these things.  And go from there.
    Hi, JohnB352
    Thanks for the suggestions. I have monitored the server and can see that the memory is nearly maxed out with a lot of hard faults (varies between several hundred to several thousand), recorded during normal usage. The Disk and CPU seem normal.
    I'm going to replace the RAM and double it up to 12GB.
    Thanks! This may help with some other issues we are having. I'll post back after it has been done.
    [Edit]
    Forgot to mention: there are 6 drives in the server. 2 for the OS (Mirrored RAID 1) and 4 for the data (Striped RAID 5).

  • How can I find out the progression on a file copy operation

    I was wondering how when I use a file stream to copy a file how much is done and how much I have to go?

    You can't. A FileInputStream gives you no method of obtaining the size of the file.
    If you have access to the File object used to create the stream then you can get the size of
    the file from that.
    Copying from a FileInputStream to a FileOutputStream will require you to use one of the
    read methods. These allow tell you (and some allow you to set) the numbe of bytes copied
    in that call. If you know how many bytes are copied in each call and also know how many
    bytes there are to copy then you can tell how far you have progressed.
    Using a RandomAccessFile as the source also allows you to determine the size of the file.
    Using FileChannels can be significantly more efficient and also allows you to determine the
    size of the source file.
    matfud

  • Windows 7 freezes on files copy operation on Macbook Pro 15" 2013 Late

    Hi,
    I use Windows installed via BootCamp on my Macbook Pro 15" 2013 Late with 512GB SSD. I installed all Apple drivers, but my laptop freezes(all windows stop responding) on a copy a lot of small files from one folder to another. After 2-5 min windows start responding again. I use Windows 7 with all upgrades.
    SSD works good in Mac OS.
    Seems Apple SSD drives in not work correctly under Windows.
    Please help!

    I have exactly the same Macbook Pro as yours but mine has the matte screen. I bought mine in September 2006 but it is classed by Apple as the 'early 2006' Macbook Pro because they released the 'late 2006' Macbook Pro in October 2006, a few weeks after I bought mine :@. As I said in my post, http://discussions.info.apple.com/thread.jspa?threadID=2307301&tstart=0 , Windows 7 is working fine on my Macbook Pro, so it should work on yours. Good luck!

  • Any way to change system sounds such as File Copy Completed sound?

    Hi folks,
    When I copy or move a file, Finder makes a sound — as you know. The particular sound it makes did not sit well with me when I first heard it (new to Mac). It sounds like an alert for a system error, or that copy failed. I thought I would get use to it, but alas, I have not.
    Is there a way I can change the sound that is used to notify me when a file copy operation has completed?
    With much thanks,
    Jonathan

    Thanks for the info.
    So I gather there is no official osx supported way to modify system sounds?
    I got used to the fact that in Linux and Windows I can specify whatever sound I like for whatever system event I like.
    Not the case on OSX?
    It begs the question, why did Apple choose such an odd sound for "file copy complete"? To me it sounds like an error occurred or the copy failed. I am getting use to it, but would have liked to be able to change system sounds, without hacking sound files.

  • Issues with File Polling and File Copy in a Cluster

    Hi,
    I have a 2 node cluster of SOA 11.1.1.5. Running into an issue.
    I have a File Poll Process which picks up new files and then copy them over to another directory [using COPY operation of file adapter]. After that using FTP Adapter to ftp the file [using MOVE operation of FTP]. Now if I place a file Poll is creating 2 instances. I have configured HAFile Adapter and HAFTPAdapter. Now if I remove the file COPY operation I see only one instance as soon as I put back file copy it creates multiple instances again. Any idea what might be wrong.
    I am following the document for file copy and ftp move http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/adptr_file.htm#BABEBJAF section
    4.5 Oracle File and FTP Adapters Use Cases
    But in a cluster if I use file copy I see multiple instances of Polling instances.
    Thanks

    "puneet" <[email protected]> wrote in message
    news:3fcf4fa4$[email protected]..
    >
    Hi I use WLI studio to add a user in a clustered environment (admin + 2managed
    wli servers). I see the following message in the logs:
    ####<Dec 3, 2003 1:05:02 PM MST> <Warning> <Security> <suznd265><eflow_2323_wli
    managed_2> <ExecuteThread: '9' for queue: 'default'> <kernel identity><14:5a2cc
    dff10338da2> <090048> <Made an in-memory only change to the FileRealm.>
    As a result, the user, that I added is not actually visible to the othermanaged
    servers in the cluster. I have verified this by having only one managedserver
    up when adding the user. Once I have added the user, I boot the othermanaged
    server and bring the first managed server down. The user I have justcreated gets
    lost.
    This occurs if you make the change on the managed server. Can you make the
    change on
    the admin server? It should get pushed to the managed servers.

  • File copy from shell using nautilus file operations?

    Is it possible to have the nautilus file operations copy command from a shell?  In other words, rather than using the cp command, I'd like to have a file copy triggered from a bash script that uses the familiar "File Operations" dialog box in nautilus.  Can this be done?

    Hello Bibin,
    Give this a try., if i understood correctly. I coudn't test it my side.
    $servers = get-content C:\hosts.txt
    foreach ($server in $servers)
    if(test-path \\Centralserver\share\$server)
    if(test-path \\$server\c$\xxx.file)
    Copy -path \\$server\c$\xxx.file -Destination \\CentralServer\share\$server\ -Recurse -ErrorVariable CopyErrorS
    #stores all your copy errors
    $copyError = $copyError + $copyerrorS
    else
    Write-Output "source file on server $server is missing"
    else
    New-Item -Name $server -ItemType Directory -path \\centralserver\share\ -Force -Errorvariabe FCreationErrorS
    #Stores all your Folder creation errors
    $FCreationError = $FCreationError + $FCreationErrorS
    if((test-path \\$server\c$\xxx.file) -and (test-path \\Centralserver\share\$server))
    Copy -path \\$server\c$\xxx.file -Destination \\CentralServer\share\$server\ -Recurse -force
    else
    Write-Output "Error creating source folder on $server."
    Regards,
    V.
    Venu

  • File copy speeds to CSV vs non-CSV

    I'm working on bringing up a 2012 R2 cluster and doing a basic test.  In this cluster, I have two adapters for iSCSI traffic, one for network traffic, and one for the heartbeat.  Cluster node has all the current updates on it.  Everything
    is set up correctly as far as I can see.  I'm taking a folder with 1GB of random files in it and copying it from the C: drive of a node to an iSCSI LUN.  If I have the LUN set up as a non-CSV disk, the copy happens about three time faster than if
    I have it set up as a CSV disk.  All I'm doing is using FCM to change the disk from CSV to non-CSV (right-click, Remove from CSV, right-click, Add to CSV).  I can swap it back and forth and each time the copy process is about three time slower when
    it's a CSV.  Am I missing something here?  I've been through all the usual stuff with regard to the iSCSI adapters, MPIO, drivers, etc.  But I don't think that would have anything to do with this anyway.  The disk is accessed the same with
    regard to all that whether it's CSV or not, unless I'm missing something.  Right now, I only have a single node configured in the cluster, so it's definitely not anything to do with the CSV being in redirected mode.
    I'm not trying to establish any particular transfer speed, I know file transfers are different than actual workloads and performance tools like iometer when it comes to actual numbers.  But it seems to me like the transfers should be close
    to the same whether the disk is a CSV or not, since I'm not changing anything else. 

    Which system owns the CSV?  If the system from which you are copying does not own the CSV then all the metadata updates have to go across the network to be handled by the node that does own the CSV.  If you are copying a lot of little
    files, there is more metadata.
    Actually, metadata updates always happen in redirected IO from what I'm reading, that has been the part that I was missing.  This explains it. 
    https://technet.microsoft.com/en-us/library/jj612868.aspx?f=255&MSPPError=-2147217396 "When certain small changes occur in the file system on a CSV volume, this metadata must be synchronized on each of the physical nodes that access the
    LUN, not only on the single coordinator node... These metadata update operations occur in parallel across the cluster networks by using SMB 3.0. "
    So a file copy, even when done on a coordinator node, does the metadata updates in redirected mode.  Other articles seem to say the same thing, though not always clearly.  So it's still accurate to say that a file copy isn't the best way to measure
    CSV performance, but there doesn't seem to be a lot of pointing to the (I think) important distinction regarding how the metadata updates work.  From what I can see, that distinction is probably trumping anything else such as who is the
    coordinator node, CSV cache, etc.  For me anyway, it makes a 3X performance difference, so I think that's pretty significant.  

  • File copy/paste adds " - Copy" - how to change to " - Copy" + date/time?

    Is there any way I can change the default file copied name from having " - Copy" at the end to " - Copy" plus the date and time?
    Before editing files I always make a copy of the existing file so I have a backup. I do this by clicking on the file I want to change in the list of files then do Ctrl C and Ctrl V which creates a copy of the file at the end of the list of times, with "- Copy" at the end of the name in the format "index - Copy.php". Is there any way I can get Dreamweaver to add the date and time to the name which would save me from editing the name and adding the date and time every time. Its a pain having to do this but I don't know any other way to ensure I know the date and time the file was copied. I know that there is a Modified date and time but changing a template for instance changes that and besides the file could also be edited but having the name reflect the copy date/time allows me to have the Modified date/time as a double check. I would like to have the file name in the format "index - Copy20110216 1621.php", the date being the international format and the time slotted on the end of it. This then puts the files in date/time order in the list.

    There's no way of customising a copied file name using DW that I'm aware of.
    Either rename it manually in DW or use a 3rd party file copy utlity outside DW.
    Is there a reason for keeping a hard copy of the last copied date that the Last Modified date in the operating system does not record?

  • Any solutions to Apple's poor file copy function

    For many years Apple's OS - all versions on all computers does not have the intelligence to copy files from drive to drive.  Does anyone know of a different software program that can help the Apple OS do this simple task?
    A little more info - I have never been able to get any Apple product - all the way back to System 7 to be able to copy files unattended.  The latest annoying problem comes from a need to move files from my Thunderbolt 1 TB SSD drive to an attached Toshiba 2TB drive.  I have a folder with about 1500 photos that I need to move from the SSD to the Toshiba drive to clear up space on my SSD drive.  I am using my MB Pro with OS 10.9.5 with 16 GB ram and a 1 TB internal SSD drive and it does not matter if I select 5 files or 500 files, it never gets more than 20 files into the copy and then very stupidly thinks some random file is in use.  No Apple OS has the intelligence to think that if this one file can't be copied at this time, that it should continue the copy operation.  The copy process shuts down then I have to look file by file to see which files it did successfully copy.  Then delete the files on the drive and select another 50 files and get another 4 or 5 copied and then do it again and again and again and again, etc... 
    I have the same problem using my Mac Pro workstation with 32 GB ram, the same problem on all 4 of my MbPro notebooks.  The problem is 100% within Apple's OS.  Obviously none of the files are ever in use.  Also, rebooting the computer does not change the situation.  Problem has existed since my PowerMac 8100/80.  It would be nice to see Apple address this problem or someone else write a basic file copy program that works.
    Thanks
    George

    Mark
    Appreciate your observations but there are a couple of issues at point
    #1 - The OS incorrectly thinks a file is in use when it is not.  It does not matter if I select and copy or drag and drop.  Minutes later the same file will usually copy.  Does not matter if it is an image from the iphone or a word doc or excel file or a video file.
    #2 - The OS is incapable of continuing a copy function when it has incorrectly told itself that a file is in use.  A superior file copy function would flag the error and continue copying.  No idea why Apple has not fixed this about a decade ago.  It has to be deeply embedded in their system software.
    The issue is the same if it is with an original Mac Pro copying between internal hard drives or involving external hard drives or a NAS drive.  It has plagued me for a very long time.  As I find hard drives that I want to move everything off of so I can reformat or replace I have to go through this painful ordeal which involves initiating the copy function hundreds of times.  I have almost finished copying 657 photos that were copied from my iPhone to the SSD drive and I wanted to get them off the SSD drive.  It took several hours yesterday and I have been at it for about 4 hours tonight.  It sure seems like it should be as easy as dragging the folder from one drive to the other and it would be if there was some way to disable that stupid "file in use" error in the Apple OS.
    Thanks
    George

  • Escaping file copy error?

    I was copying a data CD which had a bad file. When I hit the bad file, the message appeared "The Finder cannot complete the operation because some data in "the source file" could not be read or writte. (Error code -36)".
    When I click okay, the Copy message box remains, and clicking the X in that box to stop copying had no effect. I had to restart finder to escape. This is OS 10.5.4 on 2 x 2.66 GHz Dual-Core Intel Xeon Mac Pro. Thanks for any ideas. I couldn't find a bug report location in Apple Support.

    Thanks for the suggestion, but there are no permission errors on the target disk or the system disk. The problem file is on a CD, and there's no way to repair permissions on a CD.
    I think it's an OS bug that the copy dialog box won't cancel on a bad file copy error.

  • A slow file IO operation was encountered

    Hola a todos, el fin de semana hubo algunos cambios en los equipos de comunicación y ahora tengo este error en Event Viewer:
    EventID 2170 Source MSExchangeRepl
    A slow file IO operation was encountered on file 'I:\Program Files\Microsoft\Exchange Server\V14\Mailbox\DB02\E03005761DA.log' for copy 'DB02\MXSCVMMBOX02'. The observed latency was 8580.605 ms while performing a 'MissingFileNotification'. This may indicate
    an overloaded system or a storage-related problem.
    Este evento se repite continuamente. Tengo 4 servidores Mailbox los cuales pertenecen a un DAG, las unidades de almacenamiento están presentadas por Netapp conectadas vía iSCSI. El uso de red es mínimo en las tarjetas de red y todas están online y accesibles.
    Alguien tiene alguna idea?

    Translation
    Hi all, the weekend were some changes in
    communications equipment and now I have this error
    in Event Viewer:
    EventID 2170 Source MSExchangeRepl
    A slow file IO operation
    was encountered on file 'I:
    \ Program Files \ Microsoft \ Exchange
    Server \ V14 \ Mailbox \
    DB02 \ E03005761DA.log' for copy 'DB02
    \ MXSCVMMBOX02'. The
    Observed was 8580.605 ms
    latency while performing a 'MissingFileNotification'.
    This May Indicate an overloaded
    system or a storage-related
    problem.
    This event repeats continuously. I have 4
    Mailbox servers which belong to a
    DAG, the storage units are made by
    Netapp connected via iSCSI. Network usage
    is minimal network cards and they are all
    online and accessible.
    Anyone have any idea?
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help.

  • LOOOOOONG pauses in Windows Explorer with file copy, rename, new folder, etc.

    I am using Windows 7 64-bit pro and I am experiencing horribly long pauses in Windows Explorer on very simple file operations, such as renaming a file, copying a file, creating a new folder, etc. Here is an example:
    1. Open a folder in windows explorer, e.g. My Documents
    2. Select a file
    3. Hit F2 and enter a new name for the file, then hit ENTER to save the name
    4. Windows Explorer now shows the wait cursor and becomes completely unresponsive, sometimes for MINUTES.
    This is crazy. I read somewhere it may be due to shell extensions -- another post specifically called out MagicDisc, but I uninstalled that and still have the problem. After a fresh reboot the problem usually is not there immediately, but always comes back eventually.
    Anyone have any ideas?

    Hi Lex3001,
    I would like to confirm what are the results in Safe Mode and Clean Boot?
    I also would like to suggest you run ShellExView again and disable some shell extensions to check the issue.
    Run ShellExView
    =================
    1. Launch ShellExView again and scan the computer.
    2. Press "Ctrl" on the keyboard and click all items which are marked in pink in the list.
    3. Choose "File" then "Disable Selected Items".
    4. Quit and restart the computer to check the Windows Explorer issue again.
    Does it work?
    In addition, I also would like to suggest you create a new user account to check the result
    Regards,
    Arthur Li - MSFT

  • File Copy Dialog box hangs in mid-copy; Cancel does nothing.

    Hi all,
    I'm having the aforementioned issue fairly often with Windows 7.  It seems to happen when copying to network shares.  It is more than annoying--it is literally stopping production at our company.  I would really appreciate an realistic fix
    for this--that is, one that isn't the catch-all "Reinstall windows".
    Let me further state that it has nothing to do with hardware--I can reliably copy the same files in XP.  It is a Windows 7/Explorer thing.
    It also seems to be size-related--but I haven't had the time to do scientific testing to verify this.  I know that if I'm copying an Access .mdb file from my development machine (Windows 7) to a client machine (mostly windows XP) with a mapped drive,
    it seems to hang.  But if I compact/repair the .mdb file and bring it from, say 25 meg to 12 meg, it seems to copy fine.
    Worse, is that when it hangs, I'll finally hit "Cancel" after a few minutes, and then the entire Windows 7 locks!!  I can't do anything until I ctrl-alt-del and kill the Explorer.exe process, which wipes out my desktop, etc, until Explorer.exe auto-starts.
    This is such a huge problem that I  have to think there's a fix upcoming.
    Thanks,
    --Jim

    Hi,
    May I know how it works if you copy files between local drives? Please also boot the system to Safe Mode with networking and check this issue.
    In addition, may I know more information about the machine which hosts the share folder you mapped is located, a Windows based computer? Please also
    let us know the operating system.
    Based on my research, I would like to suggest the following:
    1.   
    Try disabling Receive Side Scaling, Chimney Offload, and NetDMA support and see if it works:
    Information about the TCP Chimney Offload, Receive Side
    Scaling, and Network Direct Memory Access features in Windows Server 2008
    2.   
    Also run the following commands in Windows 7:
    netsh interface tcp set global autotuninglevel=disabled
    netsh int ip set global taskoffload=disabled
    3.   
    Try Robocopy:
    Get to Know Robocopy for More Powerful File Management
    For detail information about the usage of the Robocopy command, please also refer to:
    Robocopy
    Meanwhile, I would like to share the following with you for your reference:
    Slow Large File Copy Issues
    Windows Explorer and SMB Traffic
    Hope this helps.
    Thanks.
    Nicholas Li - MSFT
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

Maybe you are looking for