The memory leak was because on the server restrart the array of extensionContext.substiptions was not cleared