![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Hello Nick In my test, when 'long i' grows to about 16384 or 16385, I see the error. 16384 * 1024 * 1024 * 1024 bytes = 16 TB. The exception was thrown because you hit the sparse file size limit. See the section "Can They Really Be That Large?" in http://www.flexhex.com/docs/articles/sparse-files.phtml. Please let me know whether it answers the question. Regards, Jialiang Ge (jialge (AT) online (DOT) microsoft.com, remove 'online.') Microsoft Online Community Support ================================================= Delighting our customers is our #1 priority. We welcome your comments and suggestions about how we can improve the support we provide to you. Please feel free to let my manager know what you think of the level of service provided. You can send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com. This posting is provided "AS IS" with no warranties, and confers no rights. ================================================= |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
Hi Nick I tested the exactly same code on both my x86 and x64 machines, and it got to 16384. 1. Does it consistently get to 112 in multiple tests on your side? Or does it get to a random number around 112? 2. Can you be double sure that your drive is formatted as NTFS, and does have enough physical space for the file considering Size on Disk? 3. http://www.flexhex.com/docs/articles/sparse-files.phtml quote You can create a largest possible 16 terabyte sparse file if and only if it consists of a single sparse zero area, no data at all. Writing even a single data byte drops the size limit far, far below. The exact limit depends on many factors: availability of system resources, the layout of the real data areas, even the order of the I/O requests; *in some cases the limit may be as low as several hundreds gigabytes.* If you don't mind experimenting, you can use FlexHEX to find your system limit. /quote I will ask the product group for the condition in which the limit may be as low as several hundred gigabytes. 4. You may consider debugging into the line file.Seek(i * 1024 * 1024 * 1024, SeekOrigin.Begin); with BCL source code: http://referencesource.microsoft.com/downloadsetup.aspx I debugged into it, and when it hits the limit (16385), I got the HRESULT 0x00000057 from WriteFileNative. You may check whether it's the same error code on your side. Regards, Jialiang Ge (jialge (AT) online (DOT) microsoft.com, remove 'online.') Microsoft Online Community Support ================================================= Delighting our customers is our #1 priority. We welcome your comments and suggestions about how we can improve the support we provide to you. Please feel free to let my manager know what you think of the level of service provided. You can send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com. This posting is provided "AS IS" with no warranties, and confers no rights. ================================================= |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
Hi Nick I was using .NET 2.0 too. According to PG's comments, there is a limit to the number of extents a file can have. The limit you see at 112gb is in the range. A heavily fragmented file in an NTFS volume may not grow beyond a certain size http://support.microsoft.com/default.aspx?scid=kb;en-us;967351 But why can the corresponding C/C++ code run well? Here is an explanation. Please help to check whether it is the case: You haven't provided the C code that has the same code logic, it's possible that the C/C++ code only appears to be succeeding. If the code uses a 'long' data type for i, then computing the seek offset as i *1024 * 1024 * 1024 will just result in an overflowed long, i.e. some offset < 2GB. To seek to large offsets properly requires using a LARGE_INTEGER and SetFilePointerEx (or messing with two LONGs and SetFilePointer). In C#, the 'long' data type is 64 bits (http://msdn.microsoft.com/en-us/library/yyaad03b(VS.71).aspx), so the C# program is the one that is accurately demonstrating NTFS behavior. Regards, Jialiang Ge (jialge (AT) online (DOT) microsoft.com, remove 'online.') Microsoft Online Community Support ================================================= Delighting our customers is our #1 priority. We welcome your comments and suggestions about how we can improve the support we provide to you. Please feel free to let my manager know what you think of the level of service provided. You can send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com. This posting is provided "AS IS" with no warranties, and confers no rights. ================================================= |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
Hello Nick A product group member tells me that you are more likely running into a system level insufficient resource. Would you please try increasing your page file max size? Regards, Jialiang Ge (jialge (AT) online (DOT) microsoft.com, remove 'online.') Microsoft Online Community Support ================================================= Delighting our customers is our #1 priority. We welcome your comments and suggestions about how we can improve the support we provide to you. Please feel free to let my manager know what you think of the level of service provided. You can send feedback directly to my manager at: msdnmg (AT) microsoft (DOT) com. This posting is provided "AS IS" with no warranties, and confers no rights. ================================================= |
#10
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |