refactored erlog_memory