Out of memory. We suggest restarting the application. If you have an unsaved document, create a backup copy in Finder, then try to save.

hello

i recently got a NSMallocException crash which is Out of memory. We suggest restarting the application. If you have an unsaved document, create a backup copy in Finder, then try to save.

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  0

Last Exception Backtrace:
0   CoreFoundation                	0x199e72b28 __exceptionPreprocess + 164 (NSException.m:249)
1   libobjc.A.dylib               	0x191cc2f78 objc_exception_throw + 60 (objc-exception.mm:356)
2   CoreFoundation                	0x199f3eb60 _CFRaiseMemoryException + 44 (NSException.m:969)
3   CoreFoundation                	0x199f3d5f4 __CFStringHandleOutOfMemory + 36 (CFString.c:1049)
4   CoreFoundation                	0x199da92d4 __CFStringChangeSizeMultiple + 2356 (CFString.c:1123)
5   CoreFoundation                	0x199da6a84 __CFStringCheckAndReplace + 364 (CFString.c:6140)
6   CoreFoundation                	0x199dcfb08 -[__NSCFString replaceCharactersInRange:withString:] + 40 (CFObject.m:605)
7   Foundation                    	0x198c7b3a0 -[NSConcreteMutableAttributedString replaceCharactersInRange:withString:] + 176 (NSAttributedString.m:1210)
8   Foundation                    	0x198c7afd8 -[NSConcreteMutableAttributedString initWithString:attributes:] + 156 (NSAttributedString.m:1031)
9   UIKitCore                     	0x19c0c0ef0 -[NSAttributedString _ui_synthesizeAttributedSubstringFromRange:usingDefaultAttributes:] + 104 (UILabel.m:162)
10  UIKitCore                     	0x19c0c050c -[UILabel _synthesizedAttributedTextForContent:] + 604 (UILabel.m:1161)
11  UIKitCore                     	0x19c0c020c -[UILabel _synthesizedAttributedText] + 68 (UILabel.m:1200)
12  UIKitCore                     	0x19c0bfef4 _UIComputedSizeForLabel + 784 (UILabel.m:1931)
13  UIKitCore                     	0x19c0bf738 -[UILabel _textRectForBounds:limitedToNumberOfLines:includingShadow:] + 448 (UILabel.m:2117)
14  UIKitCore                     	0x19c0bf488 -[UILabel _intrinsicSizeWithinSize:] + 440 (UILabel.m:3690)
15  UIKitCore                     	0x19c0a091c -[UILabel intrinsicContentSize] + 276 (UILabel.m:3739)
16  UIKitCore                     	0x19c09e5d4 -[UIView _generateContentSizeConstraints] + 52 (NSLayoutConstraint_UIKitAdditions.m:2321)
17  UIKitCore                     	0x19c09e3c4 -[UIView _updateContentSizeConstraints] + 280 (NSLayoutConstraint_UIKitAdditions.m:2269)
18  UIKitCore                     	0x19c09e278 -[UIView(AdditionalLayoutSupport) _updateSystemConstraints] + 88 (NSLayoutConstraint_UIKitAdditions.m:4719)
19  UIKitCore                     	0x19c0a0d78 -[UILabel _updateSystemConstraints] + 52 (UILabel.m:2193)
20  UIKitCore                     	0x19c09e13c -[UIView(AdditionalLayoutSupport) _sendUpdateConstraintsIfNecessaryForSecondPass:] + 348 (NSLayoutConstraint_UIKitAdditions.m:4429)
21  UIKitCore                     	0x19c09ded4 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 776 (NSLayoutConstraint_UIKitAdditions.m:4526)
22  UIKitCore                     	0x19c09dde4 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 536 (NSLayoutConstraint_UIKitAdditions.m:4507)
23  CoreAutoLayout                	0x1bae104a8 -[NSISEngine withBehaviors:performModifications:] + 84 (NSISEngine.m:1995)
24  UIKitCore                     	0x19c09dbac __100-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:]_block_invoke + 124 (NSLayoutConstraint_UIKitAdditions.m:4572)
25  UIKitCore                     	0x19c04a834 -[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateExists:] + 112 (NSLayoutConstraint_UIKitAdditions.m:4241)
26  UIKitCore                     	0x19c1577b8 -[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:] + 172 (NSLayoutConstraint_UIKitAdditions.m:4571)
27  UIKitCore                     	0x19c195684 -[UIWindow(UIConstraintBasedLayout) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:] + 88 (NSLayoutConstraint_UIKitAdditions.m:672)
28  UIKitCore                     	0x19c03664c -[UIView _updateConstraintsAtEngineLevelIfNeededWithViewForVariableChangeNotifications:] + 388 (NSLayoutConstraint_UIKitAdditions.m:4847)
29  UIKitCore                     	0x19c0361e0 -[UIView _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 324 (UIView.m:14180)
30  UIKitCore                     	0x19c0369d4 -[UIView(Hierarchy) layoutSubviews] + 192 (UIView.m:14256)
31  UIKitCore                     	0x19c0350f8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1528 (UIView.m:20041)
32  QuartzCore                    	0x19b45fe30 CA::Layer::layout_if_needed(CA::Transaction*) + 504 (CALayer.mm:10816)
33  QuartzCore                    	0x19b45f9b4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 148 (CALayer.mm:2598)
34  QuartzCore                    	0x19b465bb4 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 464 (CAContextInternal.mm:2760)
35  QuartzCore                    	0x19b45f1bc CA::Transaction::commit() + 648 (CATransactionInternal.mm:432)
36  QuartzCore                    	0x19b45ee64 CA::Transaction::flush_as_runloop_observer(bool) + 88 (CATransactionInternal.mm:942)
37  UIKitCore                     	0x19c0ad260 _UIApplicationFlushCATransaction + 52 (UIApplication.m:3160)
38  UIKitCore                     	0x19c0acd78 _UIUpdateSequenceRun + 84 (_UIUpdateSequence.mm:119)
39  UIKitCore                     	0x19c0ac468 schedulerStepScheduledMainSection + 144 (_UIUpdateScheduler.m:1037)
40  UIKitCore                     	0x19c0ac524 runloopSourceCallback + 92 (_UIUpdateScheduler.m:1186)
41  CoreFoundation                	0x199dbd62c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1957)
42  CoreFoundation                	0x199dbc8a8 __CFRunLoopDoSource0 + 176 (CFRunLoop.c:2001)
43  CoreFoundation                	0x199dbb058 __CFRunLoopDoSources0 + 244 (CFRunLoop.c:2038)
44  CoreFoundation                	0x199db9d88 __CFRunLoopRun + 828 (CFRunLoop.c:2955)
45  CoreFoundation                	0x199db9968 CFRunLoopRunSpecific + 608 (CFRunLoop.c:3420)
46  GraphicsServices              	0x1de0af4e0 GSEventRunModal + 164 (GSEvent.c:2196)
47  UIKitCore                     	0x19c22cedc -[UIApplication _run] + 888 (UIApplication.m:3692)
48  UIKitCore                     	0x19c22c518 UIApplicationMain + 340 (UIApplication.m:5282)
49  Falo                          	0x10115df50 main + 88 (main.m:11)
50  dyld                          	0x1bd2dad84 start + 2240 (dyldMain.cpp:1298)

is anyone know how and why it happend?

Replies

Is this is an app that you’re creating? If so, please post a full crash report, per the advice in Posting a Crash Report.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

thanks for the reply and yes its app we created. i have attached the crash log file. pls have a check again

Thanks for the crash report.

Frame 6 in the backtrace for thread 0 suggests that you have a third-party crash reporter in play:

6 Falo … BLYCPPExceptionTerminate() + 2044

Third-party crash reporters make things hard, for the reasons I explain in Implementing Your Own Crash Reporter.

If you remove that crash reporter do you still see the crash? If so, please post a new crash report based on that.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thanks for the reply. we do have a third-party crash reporter and it helps to collect crashes happened in our app.

The backtrace for thread 0 i found in the crash reporter should be like this:

Does it helps to know this crash better? And what the "???" means?

I’m sorry but I can’t help you with third-party crash reports. Implementing Your Own Crash Reporter explains why.

If you can reproduce the problem in your office, you could temporarily disable your third-party crash reporter, trigger the crash, and post the Apple crash report.

If you’re only seeing this problem in the field, you’ll have to balance the benefits you get from this third-party crash reporter against the problems it causes. My experience is that third-party crash reporters ofter make it easier to debug easy problems but harder to debug hard problems, which is kinda not what you want.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

hello, thanks for reply. sorry we can not reproduce the problem in my office. but i find the backtrace on the third party reporter.


Thread 0 name:  com.apple.main-thread

CoreFoundation    ___exceptionPreprocess (in CoreFoundation)

libobjc.A.dylib    _objc_exception_throw (in libobjc.A.dylib)

CoreFoundation    __CFRaiseMemoryException (in CoreFoundation)

CoreFoundation    ___CFStringHandleOutOfMemory (in CoreFoundation)

CoreFoundation    ___CFStringChangeSizeMultiple (in CoreFoundation)

CoreFoundation    _CFStringAppend (in CoreFoundation)

CoreFoundation    __CFURLComponentsCopyString (in CoreFoundation)

CoreFoundation    __CFURLComponentsCopyURLRelativeToURL (in CoreFoundation)

Foundation    -[__NSConcreteURLComponents URL] (in Foundation)

Foundation    -[NSURL(NSURL) initWithString:relativeToURL:encodingInvalidCharacters:] (in Foundation)

Foundation    +[NSURL(NSURL) URLWithString:relativeToURL:] (in Foundation)

Falo    -[FaloDuanXinController tableView:cellForRowAtIndexPath:] (in Falo:FaloDuanXinController.m:415)

UIKitCore    -[_UIFilteredDataSource tableView:cellForRowAtIndexPath:] (in UIKitCore)

UIKitCore    -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] (in UIKitCore)

UIKitCore    -[UITableView _updateVisibleCellsForRanges:createIfNecessary:] (in UIKitCore)

UIKitCore    -[UITableView _updateVisibleCellsNow:] (in UIKitCore)

UIKitCore    -[UITableView layoutSubviews] (in UIKitCore)

UIKitCore    -[UIView(CALayerDelegate) layoutSublayersOfLayer:] (in UIKitCore)

QuartzCore    CA::Layer::layout_if_needed(CA::Transaction*) (in QuartzCore)

QuartzCore    CA::Layer::layout_and_display_if_needed(CA::Transaction*) (in QuartzCore)

QuartzCore    CA::Context::commit_transaction(CA::Transaction*, double, double*) (in QuartzCore)

QuartzCore    CA::Transaction::commit() (in QuartzCore)

QuartzCore    CA::Transaction::flush_as_runloop_observer(bool) (in QuartzCore)

UIKitCore    __UIApplicationFlushCATransaction (in UIKitCore)

UIKitCore    __UIUpdateSequenceRun (in UIKitCore)

UIKitCore    _schedulerStepScheduledMainSection (in UIKitCore)

UIKitCore    _runloopSourceCallback (in UIKitCore)

CoreFoundation    ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ (in CoreFoundation)

CoreFoundation    ___CFRunLoopDoSource0 (in CoreFoundation)

CoreFoundation    ___CFRunLoopDoSources0 (in CoreFoundation)

CoreFoundation    ___CFRunLoopRun (in CoreFoundation)

CoreFoundation    _CFRunLoopRunSpecific (in CoreFoundation)

GraphicsServices    _GSEventRunModal (in GraphicsServices)

UIKitCore    -[UIApplication _run] (in UIKitCore)

UIKitCore    _UIApplicationMain (in UIKitCore)

Falo    main (in Falo:main.m:11)

dyld    start (in dyld)

and it crashed at

[cell.touxiangImageView sd_setImageWithURL:[NSURL URLWithString:kSmallImageUrl(self.user.image_url)]];

kSmallImageUrl just for getting a right URL of the user avatar

#define kSmallImageUrl(url) ([url hasPrefix:@"http"]) ? url : [NSString stringWithFormat:@"%@%@?x-oss-process=image/resize,w_200,h_200",FALO_CDN_URL,url]

And the used memory we caught on the third party SDK shows the memory not really high when crashed like around 150MB

I guess its not a memory leak but might be memory suddenly increases in a short time.

I would appreciate if you have any idea about why this crash happened.