Browse Source

fix(fastrun): release free blocks before profiling

GitOrigin-RevId: b0d9887e9a
release-1.2
Megvii Engine Team 4 years ago
parent
commit
27503620a5
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      src/opr/impl/search_policy/profiler.cpp

+ 3
- 0
src/opr/impl/search_policy/profiler.cpp View File

@@ -234,6 +234,9 @@ typename TimedProfiler<Opr>::TResult TimedProfiler<Opr>::prof_impl(
using namespace std::literals;
std::this_thread::sleep_for(1000us);
}
// release all free blocks owned by child process,
// in order to avoid main process running out of memory
cn.try_coalesce_all_free_memory();

mgb_assert(ev_start->finished());
return TResult::from_pod(Result{ev_start->elapsed_time_until(*ev_end)});


Loading…
Cancel
Save