1

When the kernel swaps stuff to disk, can this data be subsequently read by the process directly from swap? or it must absolutely be put back into physical ram (thus generating si so activity in vmstat)

I have a java process that seems to have alot of data in swap (https://paste.fedoraproject.org/542447/raw/) And when I execute it it's really slow, but I don't see any si so activity.

Upon restarting the process, it's very fast again, and smaps now lists 0 bytes in Swap.

Vmstat info: https://paste.fedoraproject.org/542453/raw/

Thank you,

Bob
  • 49

1 Answers1

0

Processes, including java, are not aware of where their memory is located. All java knows is it tried to access memory location 0x00234525. When the kernel sees access, it'll either return the value out of RAM, or page the memory in from swap to RAM and return the value from RAM. The page has to be read into RAM before it can be accessed.

That said, a single line of vmstat shows the average over the entire uptime is not very useful. Run vmstat 5 while the process is running to see the live data.

Jason Martin
  • 5,193