应用程序在ipod touch上占用17GB的内存

时间:2013-02-24 08:23:21

标签: ios xcode

I have something very strange going on. My application, quite a simple application, has it it's bundle a 200mb video as a tutorial, and when the app is opened for the first time, it saves to the Documents directory a photo (4mb). It also does a lot of NSUserDefult saving (20 more or less), but all of them are strings and numbers. At first the documents and data of my app us 0gb, but after 1 hour of usage it goes up even to 17gb, untill it fills up the memory.

我有一些非常奇怪的事情发生。我的应用程序,一个非常简单的应用程序,它捆绑了200mb视频作为教程,当应用程序第一次打开时,它将一张照片(4mb)保存到Documents目录。它还可以节省很多NSUserDefult(20或更多),但所有这些都是字符串和数字。起初我的应用程序的文档和数据是0gb,但是在使用1小时后它甚至达到17gb,直到它填满了内存。 你们有谁知道为什么?

编辑:

我经常保存这样的文件:

NSString *filename2 = [NSString stringWithFormat:@"%@%@newFile.json", destDir,   NavBar.topItem.title];

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,     NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *ReloadPath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"%@newFile.json", NavBar.topItem.title]];

[self.restClient loadFile:filename2 intoPath:ReloadPath];

并像这样写下来......

[jsonData writeToFile: uploadPath atomically: YES];

我也使用NSTemporary目录,我的分发堆栈,垃圾收集和malloc堆栈都已打开。

0 个答案:

没有答案