Layer-backed NSScrollView uses a ridiculous amount of memory
| Originator: | joshaber | ||
| Number: | rdar://9709507 | Date Originated: | 6/30/11 |
| Status: | Open | Resolved: | |
| Product: | Mac OS X | Product Version: | Mac OS X 10.6.8 |
| Classification: | Reproducible: | Always |
Summary: When a NSScrollView is layer-backed, it uses a TON more memory than when it's not. Steps to Reproduce: 1. Create an NSScrollView and mark it as layer-backed. 2. Create a custom content view. 3. Have that custom content view implement -drawRect:. 4. Observe memory usage as you scroll. Expected Results: 5. Would use roughly the same amount of memory as a non-layer-backed NSScrollView. Actual Results: 5. In my attached example project, the layer-backed NSScrollView uses 700MB RAM while the non-layer-backed uses 6MB RAM. Regression: Unknown. Notes: See attached example project. Compare the memory usage when [self.scrollView setWantsLayer:YES]; and [self.scrollView setWantsLayer:NO]; .
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!