in reply to Reasons for memory growth on Win32 IRC Bot app
A discussion on this. A discusson on releasing memory in Perl
I swear I was reading on Perl memory somewhere that it will not allocate back to the system memory until perl.exe or in your case wperl.exe exits. Or this may have been a discussion on what we were seeing with ithreads running. But it sounds like it allocates memory and has not released it to the system, though it has been freed for Perl to use, so when your bot needs the memory again it does not need to request more from the system.
To me this seems like the right thing to do because if Perl releases the memory back to the system and the program needs it again this passing of memory back and forth between system and Perl could be costly.
And actually I would have to say that is how perl works on Win32 at least it will keep all the memory it has allocated free or not until the program ends. We tested that by running our thread script and adding a loop at the end after all the threads had ended. I am going to do a test to see if we can force it to free memory by destroying all variables before looping.
Updated:
The tests I have done. Basically confirm that on the ActiveState build this is the case whatever memory Perl takes you do not get back to the Operating Sytem until the program exits. But by having variables go out of scope and passing by reference you can limit the amount of memory that perl takes from the system in total.
I would ask the more venerable here if they have any tricks that can get memory back to the system but I do see anything obvious that could be done to accomplish this.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Reasons for memory growth on Win32 IRC Bot app
by DaWolf (Curate) on Dec 03, 2003 at 14:16 UTC |