GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

memory problem

Open rschlacter opened this issue 13 years ago • 5 comments

Hi BradLarson,

Much appreciation for a good library...

Was testing it with some filters and upon using more than a certain no. of filters and video length, it starts crashing [apparently in the opengl driver?] - the details are below. It seems likely due to memory or some resource issue, since it only happens if my program does lots of allocations and video length - can be repeated and always seems to fail at this point.

Questions:

  1. Is it possible to bail out properly when starting to run out of memory/resource instead of crashing - simply as [if some alloc 'foo' fails, raise a known exception] - so client programs can gracefully handle it however...
  2. Any other way to resolve it?

Thanks for any help,

Rob

com.sunsetlakesoftware.GPUImage.openGLESContextQueue IMGSGX543GLDriver`sgxTextureGetImageRowBytes(GLDTextureRec*, unsigned int, unsigned int): 0x385f41ac: push {r4, r5, r7, lr} Getting BAD_ACCESS here

rschlacter avatar Dec 20 '12 23:12 rschlacter

BTW, using: ios6.latest on iphone4S with GPUImage.latest build

rschlacter avatar Dec 21 '12 00:12 rschlacter

Update:

Have checked above is not due to over-release, etc. but the memory footprint [real mem] was of the order of 45MB [from instruments]. But if I keep it down to around 30-35MB by reducing allocations, it was running fine.

But to be safe, I changed my code/design by removing a major component and library and brought down to 22-25MB range.

But now also its failing allocation assert check in GPUImageView::createDisplayFramebuffer {... NSAssert(framebufferCreationStatus == GL_FRAMEBUFFER_COMPLETE, @"Failure with display framebuffer generation for display of size: %f, %f", self.bounds.size.width, self.bounds.size.height); }

Now this is strange - by reducing memory usage, I am failing with FBO allocation - what gives?

rschlacter avatar Dec 21 '12 07:12 rschlacter

No difference with adding cautionary renderbuffer delinking in destroyFrameBuffer [[[GPUImageOpenGLESContext sharedImageProcessingOpenGLESContext] context] renderbufferStorage:GL_RENDERBUFFER fromDrawable:nil]; glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 0);

rschlacter avatar Dec 21 '12 07:12 rschlacter

I am facing similar problem. I am trying to play more than one videos on a single screen. The App crashes after stating the memory warning. Did you find a solution yet?

girishvr avatar Jan 17 '13 14:01 girishvr

Hi everyone! Same problem on iPad 3 ios 6.1 I found next workaround: http://stackoverflow.com/questions/13514296/ios-6-maps-occasional-crash Possible it may help you for solving this problem.

toohtik avatar Feb 03 '13 09:02 toohtik