release memory on null vector

M

moongeegee

For some reason I need to set vector to null one by one such as
v.setElementAt(null,20), v.setElementAt(null,21), v.setElementAt(null,
22) and so on.
the above code it only set the element to null but it does not free
the memory. How to free the memory.

And I like to prove that it really free the memory, please help.

Thanks.
 
R

Roedy Green

the above code it only set the element to null but it does not free
the memory. How to free the memory.

The space of the pointed to objects is reclaimed at the next GC. You
can't reclaim the space for the pointers or you could not address by
arithmetic to find the right cell.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,792
Messages
2,569,639
Members
45,353
Latest member
RogerDoger

Latest Threads

Top