I have one question. When the app is updated with the latest version , then according to you.the registry will be getting cleared.right ?
Maybe. That depends.
Registry is shared between multiple apps with the same devID.
All apps signed with devID=A can only see the registry (let's call it) "regA".
All apps signed with devID=B can only see registry "regB".
So when you deploy same app as devID=B, it cannot see regA.
RegA may or may not be cleared at that point, depending if there are other devID=A apps still installed. It's as if registries get garbage-collected - when last reference to them disappears, so do they.