Go to main content

マニュアルページ セクション 1: ユーザーコマンド

印刷ビューの終了

更新: 2022年7月27日
 
 

plimit(1)

名前

plimit - 実行中のプロセスのリソース制限の取得または設定

形式

plimit [-hkm] [--scale[=item1,,item2,...]] pid...
plimit {-cdfnstv [soft][,hard]}... pid...

説明

cdfnstv オプションが 1 つ以上指定された場合、plimit は、プロセス ID リスト pid によって識別されるプロセスの指定されたリソースのソフト (現在値) 制限およびハード (最大値) 制限を設定します。Otherwise plimit reports the resource limits of the processes identified by the process-ID list, pid.

The owner of a process is permitted to either get or set the resource limits of a process, unless the process has the {PRIV_PROC_SENSITIVE} flag set (see the getpflags(2) man page).The {PRIV_PROC_OWNER} privilege is required to get or set the resource limits of a process which is either owned by another uid or has the {PRIV_PROC_SENSITIVE} flag set.The {PRIV_SYS_RESOURCE} privilege is required to increase a hard limit.

オプション

サポートしているオプションは、次のとおりです。

–h

On output, file and memory sizes are scaled to a human readable format.The –h option is equivalent to using the –scale=max,1024 option.

–k

ファイルサイズを 512 バイトブロックではなくキロバイト (1024 バイト) で出力に表示します。

–m

ファイルサイズとメモリーサイズをメガバイト (1024*1024 バイト) で出力に表示します。

–scale[=item1,item2,...]

On output, file and memory sizes are scaled to a human readable format, for example, 14K, 234M, 2.7G, or 3.0T.Scaling is done by repetitively dividing by 1024, unless otherwise specified.

–scale specified without arguments enables default scaled output, and is equivalent to –scale=max,1024.

–scale can be specified with the following arguments.

binary

Scaling is done by repetitively dividing by a scale factor of 1024.The use of binary scaling is indicated by the addition of an 'i' modifier to the suffix (Ki, Mi, Gi, ...).

max

Values are scaled to the largest unit for which the result retains a non-zero integer part.Up to 2 decimal places of fractional output may be shown.

min

Values are scaled to the smallest unit capable of showing the full value within the allotted space of 5 columns, and displayed without the use of fractional output.

minwide

Values are scaled to the smallest unit capable of showing the full value within the allotted space of 8 columns, and displayed without the use of fractional output.

1000

Scaling is done by repetitively dividing by a scale factor of 1000.

1024

Scaling is done by repetitively dividing by a scale factor of 1024.

–?
–-help

使用法に関するメッセージを出力したあと、すぐに終了します。

残りのオプションは、指定されたリソース制限を変更するために使用します。これらは次の形式の引数を受け入れます。

soft,hard

ここで、soft は弱い (現在値) 制限、hard は強い (最大値) 制限を指定します。強い制限を指定しない場合は、コンマを省略できます。弱い制限が空の文字列である場合は、強い制限のみが設定されます。Each limit can have one of the following forms:

unlimited

The literal string unlimited indicates that no limit applies to the given resource.

n[.n][scale]

A plain number, with an optional fraction and scale factor.When specifying CPU time, the h or m scale factors can be applied, indicating hours or minutes respectively.When specifying file or memory sizes, the k, m, g, t, p, and e scale factors can be specified, denoting kilobytes, megabytes, gigabytes, terabytes, petabytes, or exabytes, respectively.

mm:ss

Minutes and seconds (for CPU time only).

弱い制限は強い制限を超えることができません。

–c soft,hard

コアファイルサイズの制限を設定します (デフォルトの単位は 512 バイトブロック)。

–d soft,hard

データセグメント (ヒープ) サイズの制限を設定します (デフォルトの単位はキロバイト)。

–f soft,hard

ファイルサイズの制限を設定します (デフォルトの単位は 512 バイトブロック)。

–n soft,hard

ファイル記述子の制限を設定します (デフォルトの単位はありません)。

–s soft,hard

スタックセグメントのサイズの制限を設定します (デフォルトの単位はキロバイト)。

–t soft,hard

CPU 時間の制限を設定します (デフォルトの単位は秒)。

–v soft,hard

仮想メモリーサイズの制限を設定します (デフォルトの単位はキロバイト)。

オペランド

次のオペランドがサポートされています。

pid

Process ID list.May be specified as a numeric id or /proc/pid.

使用例 1 Setting a limit for a single process

The following example sets the file descriptor soft limit to 1024 and does not change the hard limit, for process id 5114:

$ plimit -n 1024 5114

Note that some programs do not check if the number of file descriptors they can use has changed while running and may continue to use to the number they had at startup.

使用例 2 Setting a limit for all running processes

The following example sets the maximum core dump size (both soft and hard limits) to zero bytes for all processes running on the system:

# plimit -c 0,0 /proc/*

終了ステータス

plimit は、成功した場合はゼロ、失敗した場合 (該当するプロセスがない、アクセス権が拒否された、オプションが無効など) はゼロ以外の終了値を返します。

ファイル

/proc/pid/*

プロセス情報および制御ファイル

属性

属性についての詳細は、マニュアルページの attributes(7) を参照してください。

属性タイプ
属性値
使用条件
system/core-os

関連項目

proc(1), ulimit(1), getpflags(2), getrlimit(2), setrlimit(2), proc(5), attributes(7), privileges(7)

History

The –h and –-scale options were added in Oracle Solaris 11.4.42.

The plimit command was added in Solaris 7.