Add comments explaining choice on the cap for system memory on Windows.

[ROCm/clr commit: a91bafca40]
이 커밋은 다음에 포함됨:
Vladislav Sytchenko가 2019-12-13 21:38:27 -05:00를 커밋했습니다
1 부모 014f068e2f
커밋 dc12f8017e
1 파일이 변경됨
+4
+4
파일 보기
@@ -292,6 +292,10 @@ void memcpytest2_get_host_memory(size_t& free, size_t& total) {
MEMORYSTATUSEX status;
status.dwLength = sizeof(status);
GlobalMemoryStatusEx(&status);
// Windows doesn't allow allocating more than half of system memory to the gpu.
// Since the runtime also needs space for its internal allocations,
// we should not try to allocate more than 40% of reported system memory,
// otherwise we can run into OOM issues.
free = static_cast<size_t>(0.4 * status.ullAvailPhys);
total = static_cast<size_t>(0.4 * status.ullTotalPhys);
}