Sebastian
Sebastian

Reputation: 4811

OutOfMemoryException while downloading files in WP8

While i am trying to download the large files ( of size >170 MB ) from windows mobile application i am getting this exception

An unhandled exception of type 'System.OutOfMemoryException' occurred in System.Windows.ni.dll

Additional information: Insufficient memory to continue the execution of the program.

The strange thing is i am getting the exception only for few files. This is the code i used to download the file

       hpubDownloader = new WebClient();
        hpubDownloader.OpenReadCompleted += (s, e) =>
        {
           //process response
        };
        hpubDownloader.DownloadProgressChanged += (s, e) =>
        {
            int value = e.ProgressPercentage;
            //show progress percentage , and it shows till 98 % after that it goes to exception App_Unhandled exception
        };
        hpubDownloader.OpenReadAsync(url);

What might be the reaosn for this ? I am not getting any other details about exception and even i tried to put Try- catch block in webclient download code , but thats also not firing . What might be the possible reasons?

Upvotes: 0

Views: 632

Answers (1)

Pradeep Kesharwani
Pradeep Kesharwani

Reputation: 1478

Follow this MSDN article for more information - App memory limits for Windows Phone 8

MemoryLimits

Upvotes: 3

Related Questions