Efficient way to display Dictionary content in IMGUI(OnGUI)?

The goal:

  1. Display the content of Dictionary while OnGUI
  2. Retain the ability to modify spoken dictionary i.e. like simple, primitive GUI<->DB chain

Now, the 1) isnt hard, just iterate and display GUI elements, as best as it gets here. However, the 2) makes it trickier. The best solution I came up with is:

public void OnGUI
{
    foreach (Type object in new List<type>(Dictionary.Keys))
    {
        //lots of great stuff, including Dictionary removal/adding
    }
}

Now, here is the BIG PROBLEM:
*OnGUI implementation might be called several times per frame*
which essentially means what it means - I allocate new List<> bunch of time per frame. Now, doing a simple math it looks scary per minute at X frames. Go up to a hour and it is insane.

The things is I’m limited to OnGUI for now. Any ideas how this issue can be tackled?

Why use new List<type>(Dictionary.Keys),
why not just Dictionary.Keys it is enumerable.

Which means you wouldn’t have to make a new reference each time.