I am using a temporary dynamic array inside a loop this way:
A[] a;
for(....)
{
a=[]; //discard array contents
... appends thousand of elements to a
... use a for some calculations
}

I would like to know which would be the best way to clear a contents avoiding reallocations, as there seems to be lots of garbage collection cycles taking place.

The options would be:

a=[];
a.length=0;
a=null;
...
any other?

Can you help me please?

Reply via email to