-
-
Save dz0ny/5546e9b5e97c0b66261a362c56418fa0 to your computer and use it in GitHub Desktop.
WordPress theme memory usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'shutdown', 'do_shutdown', 999); | |
function do_shutdown() { | |
$f = fopen('/tmp/memory_usage.txt', 'a+'); | |
$usage = memory_get_peak_usage( true ); | |
fwrite( $f, $usage / 1024 / 1024 . " MB\n" ); | |
fclose( $f ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment