in reply to LWP: large post over https

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.