Click to See Complete Forum and Search --> : How to minimise memory usage URGENT !!!


Nparag
November 26th, 1999, 04:28 AM
I have coded a complex mathematical model in VB 5 which accesses an oracle database and does complex mathematical calculations. the code involves a lot of arrays. the software takes ahuge amount of memory. i am having 64 MB ram. because of the huge memory usage the software goes in non responding state. What sould I do to minimise the memory usage.

Thanx in advance

Ravi Kiran
November 26th, 1999, 04:42 AM
VB doesn't give you much leverage on these isses, unfortunately.

If you can afford it, move some sections of the complex math cals to a c dll.
Vb has an Erase funtion. so in a big function with many steps , if you are done with an array, and dont need it any more, try releasing the array with Erase. You may need to use Redim for this, than a static array.
Like instead of Dim someAr(1024) as double,
dim somear() as double
.. just before use
redim someAr(1024)
... use it and ..
Erase SomeAr

Write smaller functions and keep the arrays to local scope, and hopefully they release when they go out of scope, allowing for a smaller usage

If you are very sure of the dimentions of arrays, and done thru inital testing, then remove the Check for array bounds in the Compiler options. it may help! (in speed, more than memory! )

RK