1

I've written an app which is handling videos. As we know, video processing takes a huge amount of memory while dealing with HD resolution. My App always seemed to crash. But actually I am 100% sure, that there is no memory leak in my code. Instruments is showing no leak.

At the beginning I am startin up one OpenGLES view and the video engine. For a very short time the memory consumption is high, but falling down to normal level after the initializations are done. I am always getting memory warnings during this period. Normally this is no problem. But if I have a lot of apps in suspended mode running, the App seems to be crashing. Watching into the crash log and using the debugger shows up, that I am only running out of memory.

My customers are flooding my support mail with "app is crashing" mails. But I do know, that they have too much Apps running in the background, so there is no memory left to go. I think it's bad style programing saying the customer that he has to close Background tasks before running the app.

According to this post this is a common problem.

My question is: Is it possible to tell the OS that one needs a lot of memory so the OS should terminate some suspended Apps? This memory stuff makes me crazy, because it's no bug I could fix.

Community
  • 1
  • 1
JackPearse
  • 2,922
  • 23
  • 31

1 Answers1

1

No. It is not possible to affect anything outside of your sandbox without API calls. None exist for affecting other processes in the public API.

Have you tried to minimize your memory usage? In my experience once a memory warning it thrown apps can be more likely to have problems once they are in the background, even when memory usages drops.

If you are using OpenGLES and textures, if you haven't already compress your textures. What is the specific cause of your memory allocation spike?

logancautrell
  • 8,762
  • 3
  • 39
  • 50
  • I am using coreImage to apply some filters to the video frames. CoreImage renders images to GLES CoreImage context. I am simply creating a GLKit viewController. There is no magic. OpenGL and AVFoundation are initializing something, which generates the spikes. I am wondering about the memory warning, because it is not so much memory (about 2MB), but memory rising very fast. I tried a workaround. On the AVFoundation side I wait for OpenGL being created using NSLock, the memory warning disappeared. I assume memory usage per time is responsible for this nasty memory warnings? – JackPearse Oct 26 '11 at 08:32
  • Using google I found this source: http://codethink.no-ip.org/wordpress/archives/455 This link shows how to bypass the memory warning subsystem. And - surprise - no app termination anymore. Only 'hard' memory warnings lead to termination. This is not elegant, but works. – JackPearse Oct 26 '11 at 08:50