MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / LogHostMemoryUsage

Function LogHostMemoryUsage

oneflow/core/profiler/profiler.cpp:70–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70void LogHostMemoryUsage(const std::string& name) {
71#ifdef OF_ENABLE_PROFILER
72 int64_t vm_pages;
73 int64_t rss_pages;
74 std::ifstream ifs("/proc/self/statm");
75 ifs >> vm_pages >> rss_pages;
76 ifs.close();
77 const int64_t page_size = sysconf(_SC_PAGE_SIZE);
78 LOG(INFO) << "HostMemoryUsage: " << name << " VM " << vm_pages * page_size << " RSS "
79 << rss_pages * page_size;
80#endif // OF_ENABLE_PROFILER
81}
82
83void ProfilerStart() {
84#ifdef OF_ENABLE_PROFILER

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected