In my case, that happened when objects stored in NSCache does not conform to NSDiscardableContent protocol. When I added the said protocol, eviction of objects when the app is entering background disappears.
In addition, based on source of NSCache.m I found here, objects that do not conform to NSDiscardableContent protocol are never removed at runtime even the app needs more memory and should evict some of its elements. Maybe that's the reason why non-NSDiscardableContent objects are evicted when the app is entering background because that's a good time for them to be evicted.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…