runtime check of new/delete in cpp with logging of RAM usage