About 72 results
Open links in new tab
  1. When should I use mmap for file access? - Stack Overflow

    Nov 3, 2008 · 376 mmap is great if you have multiple processes accessing data in a read only fashion from the same file, which is common in the kind of server systems I write. mmap allows all those …

  2. linux - How does mmap work? - Stack Overflow

    Jun 12, 2018 · mmap works by manipulating your process's page table, a data structure your CPU uses to map address spaces. The CPU will translate "virtual" addresses to "physical" ones, and does so …

  3. memory - Understanding mmap - Unix & Linux Stack Exchange

    Aug 30, 2017 · I was going through documentation regarding mmap here and tried to implement it using this video. I have a few questions regarding its implementation. Does mmap provide a mapping of a …

  4. c - When would you use mmap - Stack Overflow

    Aug 23, 2012 · mmap can be used for a few things. First, a file-backed mapping. Instead of allocating memory with malloc and reading the file, you map the whole file into memory without explicitly …

  5. c - What does mmap do? - Stack Overflow

    Sep 4, 2010 · man mmap will help you here. It creates a memory mapping in the virtual address space of the process. It's creating an anonymous mapping, which is rather like using malloc to allocate n …

  6. malloc vs mmap in C - Stack Overflow

    The mmap code is faster because for your program, mmap has resulted in either less disk access, or more efficient disk access, than whatever reads and writes you compared against. For instance, …

  7. Process memory layout - difference between heap, data and mmap areas

    Feb 13, 2024 · When allocating blocks of memory larger than MMAP_THRESHOLD bytes, the glibc malloc() implementation allocates the memory as a private anonymous mapping using mmap(2). So …

  8. c++ - mmap () vs. reading blocks - Stack Overflow

    Sep 5, 2008 · The mmap() code could potentially get very messy since mmap 'd blocks need to lie on page sized boundaries (my understanding) and records could potentially lie across page boundaries. …

  9. linux - How does memory mapping a file have significant performance ...

    Oct 12, 2018 · Using mmap() maps the file to process' address space, so the process can address the file directly and no copies are required. There is also no system call overhead when accessing …

  10. Linux shared memory: shmget () vs mmap ()? - Stack Overflow

    Jan 11, 2019 · In this thread the OP is suggested to use mmap() instead of shmget() to get shared memory in Linux. I visited this page and this page to get some documentation, but the second one …