record memory usage in database