PHP Memory Issues? There's a Hack for That!

I've had to raise my php memory limits much further than I'd like just to get some normal things done in D7. The admin page for Drupal's menu system with a large menu tree can easily crush what I'd consider a healthy amount of available ram. Here is a fast and ugly fix settings.php:

$path = explode('/', $_GET['q']);
if ($path[0] == 'admin') {
  ini_set('memory_limit', '192M');
}

Hopefully this is sufficient for most cases.