News for hackers. Stuff that matters.
Re:But how, exactly, do databases use mmap? by KMag on Sunday January 24, 2021 @03:01PM (#25895293)
Oracle's JVM allocates your maximum heap size at startup, but these pages aren't actually assigned to either swap space or RAM pages until the first time they're written to (or read, but unless there's a bug in the JVM, it's not reading uninitialized memory), which triggers a page fault.

If the heap usage was high, and drops enough (maybe also needs to stay low for some time period), then Oracle's JVM will release some of the pages back to the OS using madvise, so they go back to using neither RAM nor swap space. On the one hand, the JVM should avoid repeatedly releasing pages back to the OS and then page faulting them back in moments later, but on the other, it shouldn't hold on to pages forever just because it needed them for a short time.

Re:But how, exactly, do databases use mmap? by rini17 on Sunday January 24, 2021 @03:45PM (#25895790)
This has no relevance to parent's issue: how to avoid reads that cause expensive page faults when writing to a file-backed page.
Re:But how, exactly, do databases use mmap? by KMag on Sunday January 24, 2021 @08:04PM (#25897892)
Yea, I misread "issues" as "uses". Sorry.