You could possibly try checking you don't create any circular references,
i.e. parts of your hash which refer to other parts of your hash.
Also if you have finished using a hash you could try $hash=();
And finally, try to ensure you don't use global hashes. If you use local
hashes then perl's memory recycling should kick in when the hashes go 'out
of scope'.
However I have also had simillar problems with memory leakage and perl and
currently I believe the general concensus of opion is that the only real
solution is to work out how quickly your programme gets too large and then
have it rexec itself.
Usually if it's a daemon script you have a parent process which continually
checks if your perl script is running, if it isn't it'll start it running.
This way all your perl script has to do is work out how long to remain alive
for and then gracefully exit. Your parent script will then spawn another
fresh copy.
Another option I just thought of is you could use Tied hashes, i.e. hashes
which are tied to a file, rather than memory, could give your script a
greater life expectancy,
Regards
Marty
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> [EMAIL PROTECTED]
> Sent: Friday 25 May 2001 09:02
> To: [EMAIL PROTECTED]
> Subject: Perl memory usage
>
>
> Hi All,
> I am running a fairly long perl script in which I use hashes fairly
> extensively etc. As I am developing it I naturally run the script fairly
> often. What I am noticing is that say after a day or maybe two I begin to
> get errors...not enough memory to run this application. This will even
> happen when I have practically everything closed down. I feel it
> must be the
> perl script using up memory and then not freeing it up after the
> script has
> finished. Is there any malloc type function in perl. How do you control
> memory usage. I have 256M of memory, win95 running active perl.
> Willie
> _______________________________________________
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users