Memory usage issue with CSSearchableItemAttributeSet thumbnailData

Originator:poppoppop
Number:rdar://23592687 Date Originated:18-Nov-2015 01:38 PM
Status:Open Resolved:
Product:iOS SDK Product Version:9.1
Classification:Performance Reproducible:Always
 
Summary:
When indexing a large array of searchable items in CSSearchableIndex memory usage grows and memory for any particular CSSearchableItemAttributeSet isn’t freed until all indexing is complete.

Steps to Reproduce:
1. Run the sample project at https://github.com/prendio2/CoreSpotlightSample/tree/thuumbnailData
2. Watch the memory usage in Xcode or Instruments

Expected Results:
As CSSearchableIndex successfully indexes items the memory used by its CSSearchableItemAttributeSet will be freed. 

Actual Results:
All CSSearchableItemAttributeSets stay in memory until indexing is completely finished.

Regression:
iOS 9.1, on device or simulator

Notes:
The thumbnailData is what makes this a critical issue. In the same project I am trying to index a large set of items all with the same artwork but since thumbnailData copies that data memory usage can get extremely high and kill the app on memory constrained devices.

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!