I've got a script that is relaunching icam when it quits as a stop-gap (you'll see the reference to sleeping 10 seconds before restart).
There are some sites that mention this as an issue with the Foscam 8918W but I'm not running one of those. Thoughts?
ImageIO: <ERROR> JPEG Corrupt JPEG data: 1 extraneous bytes before marker 0xd9
ImageIO: <ERROR> JPEG JPEG datastream contains no image
iCamSource(21818,0xb0513000) malloc: *** mmap(size=1228800) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
iCamSource(21818,0xb071b000) malloc: *** mmap(size=1228800) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
iCamSource(21818,0xb030b000) malloc: *** mmap(size=5242880) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
2012-11-13 01:20:05.510 iCamSource[21818:cd23] An uncaught exception was raised
2012-11-13 01:20:05.626 iCamSource[21818:cd23] NSImage: Insufficient memory to allocate pixel data buffer of 5242880 bytes
2012-11-13 01:20:05.628 iCamSource[21818:cd23] (
0 CoreFoundation 0x9a14fa67 __raiseError + 231
1 libobjc.A.dylib 0x96d69149 objc_exception_throw + 155
2 CoreFoundation 0x9a0b7289 +[NSException raise:format:arguments:] + 137
3 CoreFoundation 0x9a0b71f9 +[NSException raise:format:] + 57
4 AppKit 0x9c4b9bef NSNewBitmapBackingStore + 379
5 AppKit 0x9c6d1981 -[NSBitmapImageRep _fromCGImage:performBlockUsingMutableData:] + 186
6 AppKit 0x9c56c40b __-[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingMutableData:]_block_invoke_1 + 143
7 AppKit 0x9c3e57b6 -[NSBitmapImageRep _performBlockUsingBacking:] + 43
8 AppKit 0x9c56c377 -[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingMutableData:] + 90
9 AppKit 0x9c56c306 __-[NSBitmapImageRep _performBlockUsingBackingMutableData:]_block_invoke_1 + 114
10 AppKit 0x9c3e57b6 -[NSBitmapImageRep _performBlockUsingBacking:] + 43
11 AppKit 0x9c56c28f -[NSBitmapImageRep _performBlockUsingBackingMutableData:] + 90
12 AppKit 0x9c56c22d -[NSBitmapImageRep getBitmapDataPlanes:] + 90
13 AppKit 0x9c56c1cb -[NSBitmapImageRep bitmapData] + 40
14 iCamSource 0x000225a5 iCamSource + 136613
15 iCamSource 0x00025c07 iCamSource + 150535
16 iCamSource 0x000261ac iCamSource + 151980
17 iCamSource 0x00013f3e iCamSource + 77630
18 iCamSource 0x0000f3c8 iCamSource + 58312
19 Foundation 0x97755e25 -[NSThread main] + 45
20 Foundation 0x97755dd5 __NSThread__main__ + 1582
21 libsystem_c.dylib 0x91a87ed9 _pthread_start + 335
22 libsystem_c.dylib 0x91a8b6de thread_start + 34
)
2012-11-13 01:20:05.629 iCamSource[21818:cd23] *** Terminating app due to uncaught exception 'NSMallocException', reason: 'NSImage: Insufficient memory to allocate pixel data buffer of 5242880 bytes'
*** Call stack at first throw:
(
0 CoreFoundation 0x9a14fa67 __raiseError + 231
1 libobjc.A.dylib 0x96d69149 objc_exception_throw + 155
2 CoreFoundation 0x9a0b7289 +[NSException raise:format:arguments:] + 137
3 CoreFoundation 0x9a0b71f9 +[NSException raise:format:] + 57
4 AppKit 0x9c4b9bef NSNewBitmapBackingStore + 379
5 AppKit 0x9c6d1981 -[NSBitmapImageRep _fromCGImage:performBlockUsingMutableData:] + 186
6 AppKit 0x9c56c40b __-[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingMutableData:]_block_invoke_1 + 143
7 AppKit 0x9c3e57b6 -[NSBitmapImageRep _performBlockUsingBacking:] + 43
8 AppKit 0x9c56c377 -[NSBitmapImageRep _withoutChangingBackingPerformBlockUsingBackingMutableData:] + 90
9 AppKit 0x9c56c306 __-[NSBitmapImageRep _performBlockUsingBackingMutableData:]_block_invoke_1 + 114
10 AppKit 0x9c3e57b6 -[NSBitmapImageRep _performBlockUsingBacking:] + 43
11 AppKit 0x9c56c28f -[NSBitmapImageRep _performBlockUsingBackingMutableData:] + 90
12 AppKit 0x9c56c22d -[NSBitmapImageRep getBitmapDataPlanes:] + 90
13 AppKit 0x9c56c1cb -[NSBitmapImageRep bitmapData] + 40
14 iCamSource 0x000225a5 iCamSource + 136613
15 iCamSource 0x00025c07 iCamSource + 150535
16 iCamSource 0x000261ac iCamSource + 151980
17 iCamSource 0x00013f3e iCamSource + 77630
18 iCamSource 0x0000f3c8 iCamSource + 58312
19 Foundation 0x97755e25 -[NSThread main] + 45
20 Foundation 0x97755dd5 __NSThread__main__ + 1582
21 libsystem_c.dylib 0x91a87ed9 _pthread_start + 335
22 libsystem_c.dylib 0x91a8b6de thread_start + 34
)
Trace/BPT trap: 5
program exited, sleeping 10 seconds before restart
DVFreeThread - CFMachPortCreateWithPort hack = 0x3eced0, fPowerNotifyPort= 0x3eb310
DVFreeThread - CFMachPortCreateWithPort hack = 0x5aae00, fPowerNotifyPort= 0x5ab4f0