mojoshaneman has asked for the wisdom of the Perl Monks concerning the following question:

ActiveState v5.8.6 811
Crypt-SSLeay 0.51
Windows 2003

I'm posting a very large amount of data to a https URL. The data is not a file, but actual parameter data.

my ($response) = $ua->post($Url, \%postHash);

The $postHash has 50 Mb of data. I am watching task manager and see that the amount of memory used by perl.exe goes up past 500 Mb while calling the post and does not return to normal levels once the post returns.

My questions are:

1) Why does the post need so much memory?
2) What can I do to reduce memory use?
3) What do I need to do to get memory back once the post is completed?

Replies are listed 'Best First'.
Re: LWP: large post over https
by spiritway (Vicar) on Mar 17, 2006 at 04:19 UTC

    My assumption is that the memory gets used while encrypting the data. To reduce the amount of memory used, you can try encrypting/posting the data in smaller chunks if that's feasible. As far as getting the memory back - it becomes available to perl, but does not return to the system until perl ends. I don't know if there are any tricks or modules that might cause perl to release its hold on this memory.