[Melbourne-pm] Perl garbage collection behaviour

Sisyphus sisyphus1 at optusnet.com.au
Wed Aug 24 01:10:18 PDT 2005


----- Original Message ----- 
From: "Harley Mackenzie"

>
> Am I correct in assuming that there cant be circular references preventing
the reclamation of memory as it reclaims the memroy when the application
comes to the foreground?

Sounds reasonable in that I would not expect a garbage collection problem
related to circular references to be fixable using the technique you
describe. But I can't explain how that technique could possibly be working
at all.

>
> Why is this bizarre behaviour occuring at all with the garbage collection?
Is it because it is in a sleep state for most of the time?

Sleeping should make no difference. It may help if all variables within
loops are lexically (my) scoped - though this also defies logic.

>
> Can I initate a garbage collection in the program itself?
>

As already suggested, an 'exit' is a very good way to initiate garbage
collection. Maybe you could schedule an exit and restart every hour or so,
since it's impractical to have an exit and restart every 5 seconds. The
Win32::Process module provides a convenient way of handling such an
arrangement.

Cheers,
Rob



More information about the Melbourne-pm mailing list