locked
Possible causes for ERROR_NO_SYSTEM_RESOURCES error during fwrite RRS feed

  • Question

  • Hi,

    What all things might generate ERROR_NO_SYSTEM_RESOURCES error during fwrite operation?

    Thanks

     

     

    Monday, October 10, 2011 8:30 AM

Answers

  • Hi,

     

    Error ERROR_NO_SYSTEM_RESOURCES means that Insufficient system resources exist to complete the requested service.

     

    The reason for the ERROR_NO_SYSTEM_RESOURCES(1450) is that on x86 (32-bit) or IA64 (64-bit) systems, the maximum buffer size is just under 64MB. For X64 systems, the maximum buffer size is just under 32MB. The maximum unbuffered read and write size limits are imposed by the design of the IO manager inside the Windows executive. When an application reads or writes files that are opened with FILE_FLAG_NO_BUFFERING, the IO Manager locks the application's buffer into physical RAM and then maps the virtual addresses into physical addresses to pass to the disk device by making a memory descriptor list (MDL). The buffer size limitation comes from the maximum size MDL that the IO Manager will create. The reason for the difference between platforms is the way the maximum buffer size is calculated from the memory page size and pointer size.

     

    Please Consider the following scenario:

     

    This limitation occurs when the file is opened with FILE_FLAG_NO_BUFFERING.  When you try to create a large file in Microsoft Windows XP by moving the file pointer to the end of a file. Then you call the SetEndOfFile function. In this scenario, the SetEndOfFile function fails with error 1450 "ERROR_NO_SYSTEM_RESOURCES".

     

    Best Regards,

               Rob
    Rob Pan [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.


    • Edited by Rob Pan Wednesday, October 12, 2011 3:33 AM
    • Marked as answer by Rob Pan Monday, October 17, 2011 8:46 AM
    Wednesday, October 12, 2011 3:33 AM