0

I am a Chinese, I am not very good at English. If I say something wrong, I say sorry to you. Thank you to answer my question.

In my UWP project, I want to calculate file's MD5. I use FileOpenPicker to choose file and FileIO.ReadBufferAsync() to convert the file to IBuffer, then I use HashAlgorithmProvider.HashData() to get the MD5 result. When I choosed small files, the program can run correctly, but I choosed large files(more than 1G), I got an exception, as described below

System.OutOfMemoryException Insufficient memory to continue the execution of the program.

My computer's memory is 16GB, and the remaining memory is abundant. What should I do? Thanks!

RareNCool
  • 426
  • 8
  • 19
HappyZhang
  • 37
  • 3
  • Try use 64bit,the 32bit cant have a long stream. – lindexi Oct 07 '16 at 02:10
  • Please share your actual code (a minimal but complete code sample that we can use to reproduce the problem). If coded correctly, there is no reason to get an OOM no matter how large the file gets, and regardless of 32 vs 64 bit. – sstan Oct 07 '16 at 02:12
  • 1
    I think you have same problem with this link which already has solution: http://stackoverflow.com/questions/13534334/how-to-compute-hash-md5-or-sha-of-a-large-file-with-c-sharp-in-windows-store-a – nguyenhoai890 Oct 07 '16 at 02:17
  • Thank you to answer my question. – HappyZhang Oct 08 '16 at 01:05

0 Answers0