Reboot was required. Waiting for it resulted in nothing happening.
Upon further investigation, it was discovered that there was a memory leak in the Perl IMAP library being used. Originally, I had set up the Perl script to load all email accounts into an array (from a text file referenced from arg 1 on command-line), then loop through them running the migration code for each account. For each iteration of the loop, the script logged-in to both the source mail server and target mail servers, ran the migration code, then logged-out of both mail servers. This eventually ate up all available RAM, then all available SWAP, until finally init killed the process.
I thought I would speed things up: I used screen to run 9 of these processes, each on a different set of accounts. After launching nine of these processes, the system quickly slowed to a crawl, then stopped responding all together. I'm guessing init would have eventually killed all the Perl processes, but how long would that haven taken? Thus, a reboot was required.
I modified my Perl migration script to do one account, then exit. Then I set up a bash loop like this to loop through all accounts sourced from the same text file:
# cat run_migration4.sh
#!/bin/bash
FILE=$1
# read $FILE using the file descriptors
exec 3<&0
exec 0<$FILE
while read line
do
# use $line variable to process line
echo line: $line
./migration4.pl $line
done
exec 0<&3
This worked extremely well. I was able to run nine of these in one screen session and they all took up an insignificant amount of RAM, no where near the 4G limit of the server. The server load average never got above 2 or 3. All completed without issue.