I have an application that responds to being moved.
The listener seems to be invoked many times in one movement, i.e. if I dragged the application from one part of the monitor to another.
I store some data into a Hashtable when this happens. Each time I store data, I need to store into an empty Hashtable.
Would it be better to remove the contents of the Hashtable each time or could I just instantiate a new Hashtable (using the same variable)? The Hashtable will contain no more than 5 key/value pairs.
Would the latter method begin to consume too much memory or would the Java garbage collector free up this memory quick enough?