What does the error "Not enough system resources ..." mean?

This question covers both serverfault and stackoverflow, so I just chose this one.

I get the following exception with a simple file copy code. Its launch 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 fact is that the server that runs this code is completely new and super powerful, so I don’t understand which system resource it can run out of.

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

But I tried to add changes to the registry to increase the size of the kernel memory page, and this did not help.

, , , FileChannel transferFrom 50 . , 1 . , , 32 !

? FileChannel Windows?

+3
1

"" ID 4938442: NIO FileChannels.

: . , (, , ) .

:

  • NIO; NIO ( , )

  • , . , , , Windows XP Windows 2000. , 32 .

+4

Source: https://habr.com/ru/post/1746035/


All Articles