diff --git a/paddle/fluid/memory/allocation/system_allocator.cc b/paddle/fluid/memory/allocation/system_allocator.cc index fcfece978cb7fcc9646075a83010e75a06e0eaf6..15cd2f6d1f3719464217902d8a55afa8f94d684e 100644 --- a/paddle/fluid/memory/allocation/system_allocator.cc +++ b/paddle/fluid/memory/allocation/system_allocator.cc @@ -111,15 +111,14 @@ void CPUAllocator::Free(void* p, size_t size, size_t index) { munlock(p, size); #endif } + HOST_MEMORY_STAT_UPDATE(Reserved, 0, -size); + platform::RecordMemEvent( + p, CPUPlace(), size, platform::TracerMemEventType::ReservedFree); #ifdef _WIN32 _aligned_free(p); #else free(p); #endif - - HOST_MEMORY_STAT_UPDATE(Reserved, 0, -size); - platform::RecordMemEvent( - p, CPUPlace(), size, platform::TracerMemEventType::ReservedFree); } bool CPUAllocator::UseGpu() const { return false; } diff --git a/paddle/fluid/platform/profiler/chrometracing_logger.cc b/paddle/fluid/platform/profiler/chrometracing_logger.cc index 1e22ffe1a8dcf78208ad5ce2fb388a6179dfcd18..287628c85e50419bd33c1b9688a65a3a879e021c 100644 --- a/paddle/fluid/platform/profiler/chrometracing_logger.cc +++ b/paddle/fluid/platform/profiler/chrometracing_logger.cc @@ -546,10 +546,10 @@ void ChromeTracingLogger::HandleTypeMemset( } void ChromeTracingLogger::StartLog() { - output_file_stream_ << string_format(std::string( + output_file_stream_ << std::string( R"JSON( { - "displayTimeUnit": "ms",)JSON")); + "displayTimeUnit": "ms",)JSON"); } void ChromeTracingLogger::LogMetaInfo(const std::string& version,