Every time then I send any event, SDK creates new Hashtable() as a transient object to copy key/values from source dictionary and turn it to JSON string.
It can be fixed by using hashtable pool to reuse small bunch of created hashtables again and again.
private static string DictionaryToJsonString(IDictionary<string, object> dict)
{
Hashtable table = new Hashtable();
if (dict != null)
{
foreach (KeyValuePair<string, object> pair in dict)
{
table.Add(pair.Key, pair.Value);
}
}
return GA_MiniJSON.Serialize(table);
}