I have 1400 files (315GB), trying to optimize random access by mapping all these file, but get ERROR_NOT_ENOUGH_MEMORY on 7000 file(189GB), whats I'm doing wrogn (Windows 10, x64)
auto hFileHadnle = CreateFile(path, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0);
auto mapper_handles = CreateFileMapping(
hFileHadnle, // use paging file
NULL, // default security
PAGE_READONLY, // read access
0, // maximum object size (high-order DWORD)
filelen, // maximum object size (low-order DWORD)
0); // name of mapping object
auto data = MapViewOfFile(mapper_handles, // handle to map object
FILE_MAP_READ, // read/write permission
0,
0,
0);
CloseHandle(mapper_handles);
CloseHandle(hFileHadnle);