I'm working on a perpetual program. It runs indefinitly, checking on various servers using ping or SNMP queries. It works like I want it to but it has one major problem. It continualy grabs and uses more ram and process time with each iteration, growing until it become a detriment to the system it's running on.
I have a secondary script, an outside file, that I open and eval. Would this be bloating the memory? This file is simply a hash of data that may change while the script is running. I've set the program up, so that the data can be changed while the script is running.
Here's an example of the data it's calling.open(DATA,"data.pl"); while (<DATA>) {$data .= $_;} close DATA; eval $data;
@array = ( { label => "backup.hostname.com", status => "on", type => "ping", data => "hostname.com", user => user@hostname.com, error => 'Failed', }, );
But i digress, what I'm looking for is some tutorials on memory management. Where can I find this information, and how can I trim a bloated program while it is running. Similar to undef, but will actually free the memory up for the system.
tyric
In reply to Memory Management in Perl by tyric
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |