Opened 11 years ago

Closed 19 months ago

Last modified 4 months ago

#3925 closed enhancement (fixed)

swap-file size

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


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 (8)

comment:1 by umccullough, 11 years ago

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 by bonefish, 11 years ago

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 by anevilyak, 11 years ago

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 by axeld, 11 years ago

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 by axeld, 3 years ago

Owner: changed from axeld to nobody
Status: newassigned

comment:6 by rrobgill, 19 months ago

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

comment:7 by pulkomandy, 19 months ago

Resolution: fixed
Status: assignedclosed

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

comment:8 by nielx, 4 months ago

Milestone: R1R1/beta2

Assign tickets with status=closed and resolution=fixed within the R1/beta2 development window to the R1/beta2 Milestone

Note: See TracTickets for help on using tickets.