(ActivityPerformance) Store entities by reference to reduce memory consumption
(ActivityPerformance) Fix bug where uncollected activities can be removed from a bucket.