Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 799705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:10:23+00:00 2026-05-14T23:10:23+00:00

This question spans both serverfault and stackoverflow so I just picked this one. I

  • 0

This question spans both serverfault and stackoverflow so I just picked this one.

I get the following exception with some simple file copy code. Its running on Windows Server 2003 x64

Caused by: java.io.IOException: Insufficient system resources exist to complete the requested service
at sun.nio.ch.FileDispatcher.pwrite0(Native Method)
at sun.nio.ch.FileDispatcher.pwrite(Unknown Source)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source)
at sun.nio.ch.IOUtil.write(Unknown Source)
at sun.nio.ch.FileChannelImpl.write(Unknown Source)
at sun.nio.ch.FileChannelImpl.transferFromFileChannel(Unknown Source)
at sun.nio.ch.FileChannelImpl.transferFrom(Unknown Source)
at Tools.copy(Tools.java:473)

public static void copy(FileChannel input, FileChannel output) throws IOException {
    final long size = input.size();
    long pos = 0;
    while (pos < size) {
        final long count = (size - pos) > FIFTY_MB ? FIFTY_MB : (size - pos);
        pos += output.transferFrom(input, pos, count);
    }
}

The thing is the server that is running this code is brand new and super powerful, so I don’t understand what system resource it could possibly be running out of.

This looks like the error described here:
http://support.microsoft.com/kb/304101

But I’ve tried adding the registry edits to increase kernel memory page size, and that didn’t help.

What I really don’t get is I’ve seen code that uses FileChannel transferFrom with a lot larger chunks of 50 MB. I’ve seen that code work for files well over 1 GB in one chunk. But the file the server is getting stuck on is just 32 MB!

What is going on here? Is this a problem with FileChannel or Windows?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T23:10:23+00:00Added an answer on May 14, 2026 at 11:10 pm

    It may be related to "Bug" ID 4938442: Insufficient System Resources When Copying Large Files with NIO FileChannels.

    Evaluation: Not a bug. This is most likely a file-server (or possibly client)
    configuration issue.

    CUSTOMER SUBMITTED WORKAROUND :

    • Don’t use NIO; we’d prefer to avoid this workaround since
      NIO offers a significant performance boost for large files
      (at least when performing local disk-to-local disk copies)
    • We can transfer using a smaller number of bytes. The
      actual number of bytes that may be copied without
      encountering this error seems to differ on Windows XP and
      Windows 2000 server. Certainly a value of 32Mb appears to
      work.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 444k
  • Answers 444k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Assuming you mean the pair of characters, \n, as opposed… May 15, 2026 at 6:45 pm
  • Editorial Team
    Editorial Team added an answer You are using strncpy which does string copying, if you… May 15, 2026 at 6:45 pm
  • Editorial Team
    Editorial Team added an answer If your ranges are fixed and you are asking about… May 15, 2026 at 6:45 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.