Project

General

Profile

Bug #12858

Please adjust swap usage to meet reality

Added by giahung 1997tn 10 months ago. Updated 10 months ago.

Status:
Rejected
Priority:
Low
Assignee:
Category:
-
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

I used to think memory hunger is one of the attribute of Illumos and think it's usual, but it turned out to be wrong. After tried OmniOS and DilOS, I would say OI's way of using swap is too abusive. On a clean system just started up without doing anything, both top and System Monitor report about swap space being used. It's not much but increased over time to about a hundred of mb of swap. Especially when heavy task being done, e.g: install large amount of packages with pkg. Fortunately, OI does release most of the swap space after the operation was completed. But I have never seen OI without using swap. On contrary, both OmniOS and DilOS rarely used any swap at all, even after heavy operation like install a large amount of packages.

On all of these Illumos systems, I have limited the zfs max arc to 512 mb. The VirtualBox VM configuration I used for all of them is the same: 4G ram, 64G Disk and 4 cpu cores.

I have some questions to ask:

1. Is there anything equivalent to Linux's swapiness to adjust the OS's way of using swap?

2. On top's result, does used ram already included zfs arc cache or not?

3. On System Monitor's result, does used ram already included zfs arc cache or not?

#1

Updated by giahung 1997tn 10 months ago

giahung 1997tn wrote:

I used to think memory hunger is one of the attribute of Illumos and think it's usual, but it turned out to be wrong. After tried OmniOS and DilOS, I would say OI's way of using swap is too abusive. On a clean system just started up without doing anything, both top and System Monitor report about swap space being used. It's not much but increased over time to about a hundred of mb of swap. Especially when heavy task being done, e.g: install large amount of packages with pkg. Fortunately, OI does release most of the swap space after the operation was completed. But I have never seen OI without using swap. On contrary, both OmniOS and DilOS rarely used any swap at all, even after heavy operation like install a large amount of packages.

On all of these Illumos systems, I have limited the zfs max arc to 512 mb. The VirtualBox VM configuration I used for all of them is the same: 4G ram, 64G Disk and 4 cpu cores.

I have some questions to ask:

1. Is there anything equivalent to Linux's swapiness to adjust the OS's way of using swap?

2. On top's result, does used ram already included zfs arc cache or not?

3. On System Monitor's result, does used ram already included zfs arc cache or not?

I forgot to update: If you said used memory is not wasted memory, I have to disagree. OI used swap when top and System Monitor both report the system still have plenty of ram. Even when just started up and no addition applications were started, OI already used swap.

#2

Updated by Olaf Bohlen 10 months ago

  • Status changed from New to Rejected
  • Assignee set to Olaf Bohlen
  • Priority changed from Normal to Low

Hi,

I'm rejecting this as a bug, as it is not. Please also consider writing to oi-discuss Mailinglist for asking further questions: https://openindiana.org/mailman/listinfo

So first of all, the Linux kernel and the illumos kernel use different memory management. Especially when creating new processes we need the address-space of the swap device, we do not really write to it. That is the reason why we create a swap volume.
I'm not aware of any equivalents to Linux swapiness, as mentioned before: the kernel behave very different, for example we also have no OOM, as we could never run into such a scenario, as we always ensure we have the addresses a process requests.
If you want to analyze memory usage, I'd recommend running echo ::memstat | mdb -k as root, it will print out the memory distribution in your system:

(593) x230:/root# echo ::memstat | mdb -k
Page Summary                Pages                MB  %Tot
------------     ----------------  ----------------  ----
Kernel                     748883              2925   18%
Boot pages                    137                 0    0%
ZFS File Data             2133407              8333   52%
Anon                      1000724              3909   24%
Exec and libs                6821                26    0%
Page cache                  49282               192    1%
Free (cachelist)            16819                65    0%
Free (freelist)            152926               597    4%

Total                     4108999             16050
Physical                  4108998             16050

So in this system the ARC consumes about 8G RAM, user processes (anon) about 3.9G and the Kernel itself 2.9G
We have around 600MB really free RAM that can be assigned immediatly.

Regards,

Olaf

#3

Updated by Olaf Bohlen 10 months ago

  • % Done changed from 0 to 100

Also available in: Atom PDF