register 'out of memory' event when out of memory