add simulate memory warning script function