简体   繁体   English

帮助iOS应用程序崩溃“Out Of Memory”

[英]Help with iOS app crashing with “Out Of Memory”

I have an iPhone/iPad application made in MonoTouch, which is already in the apple store. 我有一个用MonoTouch制作的iPhone / iPad应用程序,它已经在苹果商店里。 However there's still an issue that hasn't been completely solved. 然而,仍有一个问题尚未完全解决。 I need to be able to upload large files to our servers. 我需要能够将大文件上传到我们的服务器。 Sizes can vary from 2-100 Mb in size. 尺寸可以从2-100 Mb变化。 I have tried several approaches: 我尝试了几种方法:

  1. Using SOAP Web Services, sending the byte array: a) Sending the whole file. 使用SOAP Web服务,发送字节数组:a)发送整个文件。 Crashed. 坠毁。 b) Splitting in chunks of 1Mb. b)分裂成1Mb块。 Crashed after 10-15 chunks (varies). 在10-15个块之后崩溃(变化)。

  2. Using WebClient.UploadFile. 使用WebClient.UploadFile。 Works most of the time with smaller files < 5 Mb, but every now and then it crashes and everything larger than 10-12 Mb crashes. 大部分时间都使用小于5 Mb的较小文件,但它偶尔会崩溃,并且大于10-12 Mb的所有文件都会崩溃。 On the server, I have a aspx page that receives the information sent through a POST 在服务器上,我有一个aspx页面,它接收通过POST发送的信息

Here is the actual code from the device: 以下是设备的实际代码:

WebClient wc = new WebClient ();
string sLFN = sLocalFileName;
FileInfo fi = new FileInfo (sLFN)
string sUri = getUri ();
byte [] f = wc.UploadFile (sUri, sLFN)

I believe that the memory capacity of the iPhone / iPad is something that directly affects this. 我相信iPhone / iPad的内存容量会直接影响到这一点。

Does anybody has any recomendation or suggested approach that I should follow? 有没有人有我应该遵循的任何推荐或建议的方法?

Thanks in advance 提前致谢

Edgar Herrador 埃德加·赫拉多尔

I'd recommend using Streaming & Chunking. 我建议使用Streaming&Chunking。 You're probably exceeding the message size when passing large files. 传递大文件时,您可能超出了邮件大小。

Are you getting any exceptions ? 你有任何例外吗?

您是否尝试过WCF流​​媒体(http://msdn.microsoft.com/en-us/library/ms733742.aspx)?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Xamarin iOS iPad应用程序崩溃,无法解释 - Xamarin iOS iPad App is crashing, unexplained 为什么我的 Unity IOS 应用程序在上传到 Xcode 后崩溃? - Why is my Unity IOS App crashing after uploading it to Xcode? Xamarin Forms iOS应用突然启动时崩溃 - Xamarin Forms iOS app crashing on start up suddenly 使用 UnobservedTaskException 停止 HockeyApp 使我的 Xamarin iOS 应用程序崩溃 - Stopping HockeyApp crashing my Xamarin iOS app with UnobservedTaskException 角色未清除,应用内存不足 - Roles not clearing, app running out of memory 使用Xamarin iOS获取可用的应用程序内存 - Get available app memory with Xamarin iOS C#应用程序始终在特定位置崩溃,需要帮助来理解问题签名 - C# app keeps crashing at specific point, need help understanding problem signature SkiaSharp:由于 memory 管理,多次旋转大图片而不会导致应用程序崩溃 - SkiaSharp: rotate big picture multiple times without crashing the app because of memory management 为什么使用Microsoft Azure移动服务时Xamarin Forms iOS应用程序崩溃 - Why is my Xamarin Forms iOS app crashing when using Microsoft Azure Mobile Services 防止应用崩溃 - Prevent app from crashing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM