locked
Out of Memory Error on FileIO:ReadBufferAsync

    Question

  • Getting Out of Memory errors on FileIO:GetBufferAsync(file) on files larger than around 300MB. However, it depends on the amount of memory installed in the system and/or how many apps are currently open.

    I am assuming the GetBufferAsync call automatically manages the IBuffer. Is there a limit to how much buffer space each app could use, if so, any way to change it?

    Can someone please provide some guidance on how to handle large files in RT apps. My application manipulates the contents of the entire file.

    Thanks in advance.

    Wednesday, July 2, 2014 2:53 AM

All replies

  • What we need to know is: why are you reading in an entire 300Mb file at once? What are you doing with this information?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, July 2, 2014 2:12 PM
    Moderator
  • Hi Matt,

    Thanks for the response. The application is for encryption/authentication of the contents of the file.

    From the documentation of GetBufferAsync it wasn't apparent to me that it is possible to read chunks of a file, it seems that it keeps reading until out of memory. Please advise if it is possible to index into a file and read smaller chunks, or any other API that can be used.

    Thanks.

    Thursday, July 3, 2014 6:39 AM
  • Can anyone help me with this issue.

    Thanks in advance.

    Wednesday, July 9, 2014 5:12 AM
  • If you'll post a reproduction app to OneDrive and share it with me, I'll check it out.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, July 16, 2014 4:06 PM
    Moderator