Opened 10 years ago

Closed 2 months ago

#3925 closed enhancement (fixed)

swap-file size

Reported by: smashIt Owned by: nobody
Priority: normal Milestone: R1
Component: System Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

just got haiku to boot natively on my laptop to my surprise haiku used ~4gb of the 8gb partition for the swapfile (2x the physical ram) does that even make sense for a 32bit system when swap-file + physical ram exceed the adressspace of 4gb?

Change History (7)

comment:1 Changed 10 years ago by umccullough

At some point, I think the Virtual Memory preferences were changed to default to 1 mb or something - but I think the system still defaults to 2x physical RAM if no preferences have been set?

comment:2 Changed 10 years ago by bonefish

Not quite sure what this ticket is about. What shall be enhanced in what way?

Regarding the technical facts:

  • There's no direct swap space related limit imposed by the size of the address space. Each process has its own address space, so the total amount of data that might need to be paged out is merely limited by the number of running processes.
  • We address pages with 32 bit indices, i.e. the current swap space limit is 16 TB. This limit could be lifted, if the need arises, though.

comment:3 Changed 10 years ago by anevilyak

With respect to the swap space + physical RAM adding up to > 4GB, this is entirely irrelevant. The 4GB address space limit is virtual per app (with the usual 2GB user / 2GB kernel split applying). As such you could hypothetically have, say, 6 apps all completely using their 2GB of userspace address area completely. This is perfectly acceptable and possible, but obviously you wouldn't be able to fit all that into RAM since on a 32-bit sys you can't have > 4GB physical without resorting to PAE hacks. As such you'd need at least 8GB of swap, probably more to support the above setup, and this is entirely possible, though you likely wouldn't do this in practice since saying it wouldn't be fun to use a system under such a load is a mild understatement.

comment:4 Changed 10 years ago by axeld

What we could do is to limit the default swap size to some percentage of the volume it's on, like not more than 10% or 25%.

comment:5 Changed 2 years ago by axeld

Owner: changed from axeld to nobody
Status: newassigned

comment:6 Changed 2 months ago by rrobgill

I believe that this was resolved by the size limitations implemented in hrev44611

comment:7 Changed 2 months ago by pulkomandy

Resolution: fixed
Status: assignedclosed

Yes, swap file size in automatic mode is now limited to 25% of the volume.

Note: See TracTickets for help on using tickets.