Fixed minimal (empty hashmap) memory leak on redeploy (#9993)

Change-Id: I2b3f83220070f1f46730d956abb24ba9edf02f20