[Melbourne-pm] Perl garbage collection behaviour

Leigh Sharpe lsharpe at pacificwireless.com.au
Tue Aug 23 23:34:23 PDT 2005

So, instead of a program which continually sleeps and wakes, why not make it
a one-shot app and have task scheduler run it at the appropriate interval?

----- Original Message ----- 
From: "Harley Mackenzie" <hjm at bigpond.com>
To: <Melbourne-pm at pm.org>
Sent: Wednesday, August 24, 2005 4:12 PM
Subject: [Melbourne-pm] Perl garbage collection behaviour

> I have an application that I have developed that regularly polls a
database table for new records, sleeps for most of the time and otherwise
periodically generates some reports and faxes. The application works fine
except for the memory behaviour, wheret 8KB of memory is used up for each
database poll (running on Windows Server 2003) as reported by Windows task
manager, with the memory requirements starting out at about 5 KB and over a
couple of days eventually exhausting all of the available virtual memory and
causing mayhem on the server.
> I initially suspected a circular reference in my Perl objects, except for
the fact that if I click on the application that is usually running in a
minimised state at the bottom of the screen, and bring it to the foreground,
and then minimise again, something kicks off the garbage collection and it
then reduces to about 5KB and starts the memory accumulation thing all over
> As this is a remote server at a client location this is pretty
inconvenient and has resulted in some nasty out of hours phone calls.
> 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?
> 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?
> Can I initate a garbage collection in the program itself?
> Thanks,
> Harley Mackenzie
> ------------------------------------------------------------------
>      Dr. Harley Mackenzie         ACN:   087 953 839
>                                   ABN:   27 087 953 839
>      HARD Software                Web:   www.hardsoftware.com
>      207 Noble Street             Tel:   +61 3 5222 3435
>      Newtown 3220, Australia      Email: hjm at hardsoftware.com
> ------------------------------------------------------------------
> _______________________________________________
> Melbourne-pm mailing list
> Melbourne-pm at pm.org
> http://mail.pm.org/mailman/listinfo/melbourne-pm

More information about the Melbourne-pm mailing list