If foreach loop isn't recommended,which container should I use to store unsorted data?

Hi guys, I need iterate a collection in Update(),I don’t care about the order,so I used HashSet to store them and use foreach loop to iterate them ,but I found that foreach has some GC problem ,so I wonder which collection is best practice in this case ?

void Update()
{
		foreach (var ele in _curHashSet) 
		{
                        //do sth.....
	         }

}

and the reason I use HashSet is this collection will be Add and Remove frequently~

According to this source HashSets don’t allocate in foreach loops so you shouldn’t have a problem with GC. Looping through a large collection in an Update loop might be problem enough though…