Well you could change your approach and go for a sparsely stored array with
the indexes needed for your arrays of arrays etc: 60000 array elements is
pretty small and the time taken to erase them should not even be noticeable.
You would just need to work out an indirect indexing system.
However I am still surprised it takes so long. What syntax are you using for
your arrays of arrays of arrays etc (both declaration and indexing)? Are you
sure its actually doing what you think its doing?
Charles
______________________
Decision Models
FastExcel 2.1 now available
www.DecisionModels.com
"GB" wrote in message
...
Tried the Erase approach.
Looks like it is no faster than letting Excel handle it itself. Based on
a
15 sec determination, it removed 852kb, which should equate to 3.4 meg a
minute, and take no more than 7 minutes to remove all the data. However,
that must have been a fast 15 secs. I have been waiting at least five
minutes and it has not freed more than a quarter of the memory that was
created by adding all of the data in.
Actually runs suprisingly fast for the amount of information that is
stuffed
in there, however clearing of the memory is taking way longer than the
program run time. Hmm.. Might have to try some other test(s). :\
Help is still needed.....
"GB" wrote:
Yes each array is dynamic.
So doing erase toplevelarray, will free all memory associated with every
dynamic array below it?
Any idea if this is faster than the cleanup performed by finishing the
program without calling the erase statement?
"Tom Ogilvy" wrote:
assume the arrays are dynamic.
erase toplevelarray
--
Regards,
Tom Ogilvy
"GB" wrote in message
...
I haven't found anything really on Memory management, but this is the
situation I am in.
I an nth level array of arrays. That means that I may have as little
as an
array of arrays, or as much as an array of arrays of arrays of
arrays,
etc...
My current usage of the application results in something like 60,000
array
cells being created. It takes no more than 5 minutes to create,
read, and
store data to all of the necessary cells, however....
When the program finishes, I currently am not doing anything to free
up
the
memory. Excel (VBA) "takes care" of it. This process is taking
about 30
minutes to destroy all of the data.
How can I free up the memory in a faster fashion? My thoughts are
these:
1. Go to the bottom of each array and set the data = nothing, and
then if
the array has more than one item, redim the array to be of size 1.
Ultimately ending up with a single array item. that will take a very
short
amount of time for VBA to clear up.
2. Some method recommended by someone here.
My concern with my first method is that the memory will still be
allocated
and that my efforts to remove each item will not have freed the
memory to
make the final closure of the program any faster.
Any ideas? I do not have access to more robust programs like Visual
Basic,
C, or C++.