NUMA: How to check in which part of RAM a C++ array is allocated?
问题 I have a server with 2 CPU's and 64GB of RAM, 32GB per CPU. I know that each CPU has it's own part of RAM, lets call them RAM1 and RAM2. I would like to make my program know on which RAM (RAM1 or RAM2) it allocates it's data. I tried to check pointers values: // put the thread at i-th CPU, using pthread_setaffinity_np TData *a = new TData[N]; ... cout << "CPU = " << i << " adress = " << a << endl; but the output looks random. I suppose that is because addresses are virtual. Is there any