Cannot use my drupal installation after enabling new custom theme I keep geting this error message on every page request:

Fatal error: Allowed memory size of 167772160 bytes exhausted (tried to allocate 36 bytes) in C:\wamp\www\mydrupal2\includes\theme.inc on line 98
Call Stack
#   Time    Memory  Function    Location
1   0.0100  142240  {main}( )   ..\index.php:0
2   0.0220  449448  drupal_bootstrap( ) ..\index.php:20
3   0.2050  3025040 _drupal_bootstrap_full( )   ..\bootstrap.inc:2259
4   0.6290  15508712    drupal_theme_initialize( )  ..\common.inc:5144


Increasing memory allowance has not had any effects. I try using drush to disable the offending theme or go back to the last working one, it's the same error message. I can't even use drush for anything else. It reports the same error message. I tried the SQL method on this drupal.org page. Same result.
theme.inc on line 98 is trying to collect theme's ancestors.

My bet is that your custom theme is wrong and it's telling Drupl that is a subtheme of itself, making Drupal the enter in an infinte loop that exhausts memory.

Double check your custom theme configuration or just move it away from Drupal directories so Drupal can't process it.