Just to be clear, It's not a Perl script that's memory hungry, it's a c++ application that we want to test/monitor with a Perl script (see my update to the OP). We are testing it exactly for the reason you suggest -- to see when it's time to reassess the algorithms/data structures used so the app stays under 2gb.
--DrWhy
"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."
Comment on Re^6: Tracking memory of a running application