I believe I know what the problem could be. Would you be willing to post the source code here so I could take a look at it? It's written in C# or VB right? The problem I think is that the maximum amount of items in an array is limited by the maximum integer size. I think since the files are so large the maximum integer limit is being reached.
If you would be willing to post the source code I would be extremely grateful!