If you get this error when you’re actively profiling, that’s not uncommon. P3 should be smart enough to turn itself off, though. It uses a lot of memory while scanning, because of how debug backtraces work in PHP.
If you get this error when you’re not actively profiling, then you’re probably very close to your memory limit without P3 and P3 just nudges it over. It’s been optimized to be light on memory when it’s active, but not profiling.
This question from P3’s FAQ should help:
Help! I used P3 and now my site is down!
First, get your site back up! There are two ways to do this. Try the emergency shutoff switch first. If that doesn’t work, delete the plugin files.
Emergency Shutoff Switch
Visit yoursite.com/wordpress/index.php?P3_SHUTOFF=1
Delete the Plugin Files
Delete wp-content/plugins/p3-profiler (the whole folder)
Delete wp-content/mu-plugins/p3-profiler.php (if it exists)
This can happen if P3 hits the memory limit on your server while it’s running. This happens most often on sites with many active plugins or a complex theme. Consider switching to the Twenty Eleven theme or deactivating a few plugins before re-running P3.
Some other alternatives to P3 are:
https://github.com/dannyvankooten/wp-plugin-profiler
https://github.com/Rarst/laps
https://wpperformanceprofiler.interconnectit.com/