As a TMap holds the key and value as objects, I too would expect them to be ref counted.
The only thing I can think of is that you might be replacing a given key value pair with a new version. i.e. you are storing object a with a key of 1, then you store object b with a key of 1. object a then loses its reference and is collected.
The only thing I can think of is that you might be replacing a given key value pair with a new version. i.e. you are storing object a with a key of 1, then you store object b with a key of 1. object a then loses its reference and is collected.