Community
Participate
Working Groups
Model elements after deletion are put into fields deletedEObjectToIdMap and newEObjectToIdMap of class IdEObjectCollectionImpl and are not removed from there anymore. This means that thay stay in memory till the project itself is closed and garbage collected. - Model elements should be removed from deletedEObjectToIdMap, when they are not needed anymore (maybe after commit or save). - Model elements should not be put to newEObjectToIdMap after deletetion, since they are already available in deletedEObjectToIdMap and can be received with a request to this map. This would save memory and would not affect performance significantly.
Well, after looking over the code once again, I've noticed that deletedEObjectToIdMap and newEObjectToIdMap semantically do the same. I've therefore removed deletedEObjectToIdMap completely. Regarding clearing the elements from the newEObjectToIdMap upon commit or save: this absolutely make sense, but we need to consider the undo mechanism when talking about clearing the caches, because the latter uses the newEObjectToIdMap to retrieve elements that may have possibly deleted. We'll need to check where to best clear the caches and when.
caches are cleared on command completion