De-allocating memory - time issue

new topic     » topic index » view thread      » older message » newer message

I have a *HUGE* object of some 10 million entries. (I now know the 
exact size 'cos I coded a status window to let me know) 
[please read this all the way thru before responding] 
 
Given that I have 48MB of ram, that 10 million bears resemblance to me 
running out of physical memory (4 bytes per integer, yep), and the ole 
PC begins to disk thrash. 
 
So, I code a "Cancel" button, press it and the program waddles on 
longer than expected. 
 
So I trace it to the line 
 
	 stack={ 
 
That line alone takes 3 minutes to execute. 
 
Now, I kind of understand there are difficulties abound in the general 
case deallocating ten million entries, most of which are copies of 
copies of copies (however many it takes to get to ten million). 
 
stack is an array of approx repeat({},55000) of which only the middle 
3200 have been updated, however each such that stack[i] is set to 
stack[i+/-1]&{x,y. 
 
So I guess reference counts are off the scale. 
 
The annoying point here, then, assuming it *is* the problem, is that 
the ref count handling is, in this unusual case, wholly irrelevant. 
 
I definately doubt there is any way to improve this, it really is not 
any kind of major problem in any sense, but on the off-chance, I am 
just asking if anyone has any suggestions. 
 
Thanks 
Pete

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu