ReDim is a misleading, overly-convenient feature. It is
not a smart way to manage memory, unless used very carefully. Each time you perform a ReDim, with or without the Preserve option, a new array is created (Preserve specifies that all elements that can fit into the new array should be copied over). It isn't necessarily your only problem, but it certainly isn't helping.
So, for example, if you have a somewhat large array of integers (say 1000), it will take up 4000 bytes. Every time the amount of data you need changes, you decide to save memory by ReDimming to a smaller or larger array so that you only hold as much memory as you need. You end up redimming to 900, then 800, then 1100, which is only 100 more integers than you started with, but if the garbage collector doesn't get a chance to make its rounds all those old arrays pile up, so you end up with three extra arrays floating around (the total of the four arrays would be 15200 bytes, compared to the original 4000 bytes). Besides that, each time you do a ReDim Preserve, all of the data needs to be copied.
This is hardly an efficient way to run things. So, what do we do? For starters, when your need for memory decreases, don't create a new, smaller array unless you aren't going to need the extra space for a long time and the difference is huge. Also, try to predict how much memory you are going to need. If you know you will usually need around 1000 integers, maybe create an array of 1500 integers so you have some breathing room before you need to create a larger array.
But of course, all this coding to be more memory efficient is a pain, which is why Microsoft already did it for you. If you are using VS 2003 there is the ArrayList class, though it is not very efficient with memory when used for structures or primitive types like Integer and Boolean. In VS 2005 we have the generic List class which maintains an array for you and manages the array's memory for you, and is used with array-like syntax.
Visual Basic:
'Create a list
Dim MyInts As New List(Of Integer)
'Add some data
MyInts.Add(1)
MyInts.Add(2)
MyInts.Add(3)
'Now we can examine that data as though we were using an array:
Dim RetrievedValue As Integer = MyInts(2) ' Get value
MyInts(0) = 4 ' Set value