Re: qemu-x86_64 runs out of memory

2022-09-26 Thread Li Zhang
I did some investigation and when I mmap 2TB memory, the PageDesc is allocated with 12GB. The count of PageDesc is about 0x8 and the size of PageDesc is 24Bytes. So memory costs about 12GB. If the size of PageDesc data is reduced, the memory should be reduced significantly. If more and more

Re: qemu-x86_64 runs out of memory

2022-09-13 Thread Alex Bennée
Andreas Schwab writes: > $ cat mmap.c > #include > #include > > int > main (void) > { > void *A; > size_t L = 0, U, Max = 0; > for (U = 1; ; U *= 2) > { > A = mmap (0, U, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, > -1, 0); > if (A == (void *) -1) >

Re: qemu-x86_64 runs out of memory

2022-09-13 Thread Richard Henderson
On 9/13/22 10:35, Andreas Schwab wrote: $ cat mmap.c #include #include int main (void) { void *A; size_t L = 0, U, Max = 0; for (U = 1; ; U *= 2) { A = mmap (0, U, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); if (A == (void *) -1) break;

qemu-x86_64 runs out of memory

2022-09-13 Thread Andreas Schwab
$ cat mmap.c #include #include int main (void) { void *A; size_t L = 0, U, Max = 0; for (U = 1; ; U *= 2) { A = mmap (0, U, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); if (A == (void *) -1) break; else munmap (A, U); } while