Re: About Eu garbage collection

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

On 20 Aug 2001, at 19:14, Henri.Goffin at sbs.be wrote:

> 
> Hi everybody!
> 
> It is probably to late to propose enhancement for 2.3 but maybe for the next
> one.
> 
> Here's my problem. A program I am working on makes use of huge sequences. Some
> of them - the biggest ones - are just used temporarily. So I thought naively
> that when the routine was done extracting useful data from thoses big
> sequences
> it would suffice to make 'huge = {}' to free up memory. But nope.
> 
> It seems that once memory has been dynamically assigned to sequences there is
> no
> way to free it until the program is done. Am i right?

It would be good if garbage collection did this, but it won't. Rumor has it that
windoze won't free up used memory until the program has quit and exited. In 
dos, it's up to you.

> - If no, can someone tell how this can be done? Re-using the same sequence
> could
> be a solution but this strategy might be very tricky to implement depending on
> the program logic

Some people, like me even, use object junk for temporary stroage, and keep 
reusing it. Or tempwhatever1 and tempwhatever2. 

If you are using dos Eu, you can prolly use the EMS api to grab blocks of 
memory and do as you wish. Since EMS pages up to 64K of memory at a 
time above one meg, you can access all your ram easily, and this should not 
interfere with whatever Eu is doing up there. Keep in mind, *you* must tell 
the api to free those pages before you exit the program.

If you don't mind a really big hit on performance, you could use a ramdrive 
and the i/o routines to access the variable.

I wonder if we had threads, you could spawn a thread to handle the huge 
sequence, and when done, kill the thread, and if windoze would reclaim the 
memory? I'm sure you can do this now with a different program, as opposed 
to a thread, by using dde or socks to do inter-process communication... have 
the other process mangle the huge vars, passing little bits to the main 
program for munging them.

Gee, this is like pascal back on dos3, trying to trick the OS to do something 
it wasn't meant to do.

Kat

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

Search



Quick Links

User menu

Not signed in.

Misc Menu