Note that there are some explanatory texts on larger screens.

plurals
  1. USalex137
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COBut I don't want to commit this virtual memory region to physical memory. I'm OK if the OS just swap out the pages while the program writes into them. I thought that was one of the advantage of using memory-mapped files: be able to access a file as if it was memory, even if the file is bigger than available physical memory. Besides, it works very well in reading. So, I'm still looking for a satisfactory solution to my problem...
      singulars
    2. COThanks for your comment. I was expecting that the OS could be clever enough to swap out dirty pages before the whole system thrashes. You see, I'm not over-committing memory: I don't mind the OS doing lots of disk IO because the idea is that the OS is supposed to be better placed than the program to manage its caches. By the way, the mapping works just fine for reading even if the pages are not full of nulls (in my code, almost every page contains some non-null byte). The OS just triggers the IOs and manages the caches just fine, which is the point in using memory-mapped files.
      singulars
    3. COIn reality, I expect the files to be accessed pretty much randomly. That's why I would like to be able to keep all the views mapped at the same time. This seems to be accepted as an OK practice, on 64-bit machine of course. See http://stackoverflow.com/questions/9261316/memory-mapped-mappedbytebuffer-or-direct-bytebuffer-for-db-implementation for example. It does work just fine for reading, but not completely well for writing. I suspect that after a while any memory access from any process forces the OS to swap out some of the dirty page loaded by the JVM process. Any suggestion to avoid this?
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload