i am testing a collection with about 400000 entity
Waw....400,000 entities are too much to have in a collection in memory.
Why do you need all these entities in memory, I'm sure you can't display all these entities to the user in one screen.
It would be better if you keep the entities in the database and not in memory.
And then you can only fetch a small portion (page) of those entities you need to display.
Only then a complete re-fetch would be much easier.
but what about deleted objects? have any idea?
For these requirement, I can only think of a Client/Server Design.
Where if you want you may cache the collection in the memory of the Server, and then whenever a client deletes an entity, updates one or adds a new one, the Server can let other connected Clients know about this change so they can update their views.