Fixes issues with logging memory usage