I haven't noticed any problems with Moodle 1.4 with the 16M memory_limit, unless I try to view the site logs. This results in the script hanging in a database call without any error messages, even with debugging turned on.
I've created a minimalistic PHP script which illustrates the problem. You can access it on my site. The URL
https://webwork2.math.ohio-state.edu/moodle/memory.php?mem=16M&rec=2394works, whereas
https://webwork2.math.ohio-state.edu/moodle/memory.php?mem=16M&rec=2395
fails.
Here is the script:
<?PHP
require_once("./config.php");
global $db;
global $CFG;
@ini_set('memory_limit' , $mem);
error_reporting(999999);
$db->debug = true;
$select = "deleted = 0 AND confirmed = '1'";
$sort = "ORDER BY lastaccess DESC";
$limit = "LIMIT 0,$rec";
$fields = "*";
$sql = "SELECT $fields FROM $CFG->prefix"
. "user WHERE $select $sort $limit";
$rs = $db->Execute("$sql");
$count = $rs->RecordCount();
//error($count);
$rs->GetAssoc(true);
error("Returned from rs->GetAssoc with $count records");
?>