procedure CheckMemLimits * ------------ Limit Memory Usage ------------ local nTotMem, nFGMem, nBGMem nTotMem= val(sys(1001)) nFGMem= val(sys(3050, 1)) nBGMem= val(sys(3050, 2)) if m.nTotMem < m.nFGMem * Adjust the pool sizes sys(3050, 1, m.nTotMem / 2) && Foreground buffer pool sys(3050, 2, min(m.nTotMem / 2, m.nBGMem)) && Background memory pool endif endproc