ibireme / YYText

Powerful text framework for iOS to display and edit rich text.
MIT License
8.84k stars 1.69k forks source link

NSTextAlignmentRight 在特定情况下内存飙升然后下降,有些机型飙升到500M导致崩溃 #854

Open yuekewei opened 5 years ago

yuekewei commented 5 years ago

[self.earningsLabel mas_updateConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo( - self.contentInsets.right); make.centerY.mas_equalTo(self.headerLabel.mas_centerY); }];

Larrycal commented 5 years ago

同没有设置宽度和高度约束后,内存飙升,可以通过设置宽度的约束临时解决。 用Instrument调试了下,发现是在_UIGraphicsGetImageFromCurrentImageContext方法中生成 bitmap 的时候导致内存飙升的。初步猜测是因为约束还未生效的时候,宽高都没有设置,某个方法可能错误的使用了较大的尺寸来分配bitmap导致内存飙升,具体原因还没有进行仔细排查。

Choice-Fei commented 4 years ago

同样遇到这个问题,没有约束宽高的时候,设置对齐方式,内存飙升