save memory data to local database when process exit