how to determine shared memory usage in Solaris 11

1

I new to Solaris, am trying to get shared memory usage in Solaris 11.

I logged-in as root and tried below commands.

ipcs -am 

IPC status from <running system> as of Tue Oct  1 12:14:30 IST 2019

T         ID      KEY        MODE        OWNER    GROUP  CREATOR   CGROUP NATTCH  SEGSZ   CPID  LPID   ATIME    DTIME    CTIME

Shared Memory:

m          3   0xffffffff --rw-rw-rw-     root     root     root     root      0   1024  9798 10993 15:14:41 15:14:46 15:13:43

It gave me 1024 bytes for shared memory id 3

id -p

uid=0(root) gid=0(root) projid=1(user.root)

prctl -n project.max-shm-memory -i project user.root

project: 1: user.root

NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT

project.max-shm-memory

        usage           8.00KB
        privileged       623GB      -   deny                                 -
        system          16.0EB    max   deny

Here I got 8 KB as usage.

In oracle documents it is written as

The prctl utility allows the examination and modification of the resource controls (rctl) associated with an active process, task, project or zone on the system. It allows access to the basic and privileged limits and the current usage on the specified entity.

Here i am confused which is current usage of shared memory ? 1024 bytes or 8 KB?

parameters
kernel
solaris
asked on Stack Overflow Oct 1, 2019 by bhanu • edited Oct 1, 2019 by Filburt

1 Answer

1

Memory is allocated on most operating systems in pages. 8 kb is the default, smallest page size on Solaris SPARC systems, thus the 1 kb shared memory segment actually uses one 8 kb page of memory.

The available page sizes for a Solaris system can be listed using the pagesize -a command:

Synopsis

/usr/bin/pagesize [-a]

Description

The pagesize utility prints the default size of a page of memory in bytes, as returned by getpagesize(3C). This program is useful in constructing portable shell scripts. Options

The following option is supported:

-a Prints out all possible hardware address translation sizes supported by the system.

answered on Stack Overflow Oct 2, 2019 by Andrew Henle

User contributions licensed under CC BY-SA 3.0