JP2000222227A - Process management system - Google Patents

Process management system

Info

Publication number
JP2000222227A
JP2000222227A JP11025791A JP2579199A JP2000222227A JP 2000222227 A JP2000222227 A JP 2000222227A JP 11025791 A JP11025791 A JP 11025791A JP 2579199 A JP2579199 A JP 2579199A JP 2000222227 A JP2000222227 A JP 2000222227A
Authority
JP
Japan
Prior art keywords
server
server process
resources
monitoring
resident
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP11025791A
Other languages
Japanese (ja)
Inventor
Yoshiaki Hara
嘉明 原
Motoaki Iwasaki
元昭 岩崎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP11025791A priority Critical patent/JP2000222227A/en
Publication of JP2000222227A publication Critical patent/JP2000222227A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To prevent the abnormal finish of a system by automatically releasing unnecessary resources held by a process when there is leakage in a resident process. SOLUTION: A monitoring process 11 monitors the resident process 12 of a monitoring object and when the quantity of its occupying resources, a passing time from starting and the number of finished processing's exceed a designated critical value, temporarily finishes the process 12 and restarts it again. Thus, since the resident process is restarted at a proper interval though it generates leakage, there is an effect of releasing unnecessary occupying resources.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は常駐プロセスの管理
方式に係り、特にクライアント・サーバシステムでコン
ピュータ資源を解放漏れするサーバの管理に好適なプロ
セス管理方式に関する。
[0001] 1. Field of the Invention [0002] The present invention relates to a resident process management method, and more particularly to a process management method suitable for managing a server that releases computer resources in a client-server system.

【0002】[0002]

【従来の技術】一般にコンピュータプログラム中のプロ
セスは、メモリなどの資源をコンピュータシステムから
動的に取得・解放しながら処理を行う。ところが、プロ
セスが資源を動的に取得して処理を行った後、不要にな
ったにも関わらず解放せず、プロセスが保持したままに
なる場合がある。このような資源の解放漏れをリークと
呼ぶ。
2. Description of the Related Art Generally, a process in a computer program performs processing while dynamically acquiring and releasing resources such as a memory from a computer system. However, after a process dynamically acquires and processes resources, it may not be released even though it is no longer needed, and may remain held by the process. Such a leak of releasing resources is called a leak.

【0003】リークした資源は取得されたプロセスに占
有され、そのプロセスが終了するまでは、他のプロセス
から使う事が不可能となる。一旦起動されると終了要求
があるまでは原則として終了しないような、常駐プロセ
スの場合、実行の度に新たな資源が割り当てられること
になる。典型的には、クライアント/サーバシステムに
おけるサーバプロセスが、これにあたる。
[0003] The leaked resources are occupied by the acquired process, and cannot be used by other processes until the process ends. In the case of a resident process that, once activated, does not terminate in principle until a termination request is issued, a new resource is allocated each time it is executed. Typically, this is a server process in a client / server system.

【0004】サーバプロセスはシステムに常駐して、ク
ライアントにサービスを提供するものである。サーバプ
ロセスは、クライアントからの要求がある度に動作する
ため、サーバプロセスがリークを起こしていると、一旦
確保した資源を解放することなく新たな資源を次々と取
得し、やがてはシステムの資源を使いきる。
[0004] A server process resides in the system and provides services to clients. Since the server process operates every time there is a request from the client, if the server process is leaking, it acquires new resources one after another without releasing the resources once secured, and eventually uses the resources of the system. Use up.

【0005】このような場合、他プロセスあるいは自プ
ロセスからシステムへの資源割り当て要求が失敗し、異
常終了する。また、システム全体の停止に及ぶ場合もあ
る。
In such a case, a resource allocation request from another process or its own process to the system fails and terminates abnormally. In some cases, the entire system may be stopped.

【0006】以上のように、リークはコンピュータシス
テムにとって重大な問題であり、この対策が重要であ
る。この問題に対し、例えば特開平9−244948号
公報に記載されているように、メモリの割当てや解除を
追跡するメモリ割当てテーブルを備えたデバッグ用のメ
モリ管理機構により、メモリリークの箇所を検出し、プ
ログラムから除去する方法が考えられる。
[0006] As described above, leak is a serious problem for computer systems, and its countermeasures are important. To solve this problem, as described in, for example, Japanese Patent Application Laid-Open No. 9-244948, a memory management mechanism for debugging provided with a memory allocation table that tracks memory allocation and release detects a memory leak location. , A method of removing it from the program is conceivable.

【0007】[0007]

【発明が解決しようとする課題】従来技術では、メモリ
等の資源のリークを検出・除去するのは、プログラムの
作成者に依っていた。しかしながら、リークの検出・除
去は非常に困難であり、実際にはリークを残したままの
プログラムがユーザに渡ることが多い。
In the prior art, it is up to the program creator to detect and remove leaks of resources such as memory. However, it is very difficult to detect and remove a leak, and in practice, a program often leaves a leak to a user.

【0008】本発明の目的は、常駐プロセスにリークが
あるとき、プロセスの保持する不要な資源を解放し、シ
ステムの異常終了を未然に防止することにある。
An object of the present invention is to release unnecessary resources held by a resident process when there is a leak in the resident process, thereby preventing abnormal termination of the system.

【0009】[0009]

【課題を解決するための手段】上記の目的は、リークを
起こしている常駐プロセスを自動的に一旦停止させ、再
び起動することによって達成される。
The above object is achieved by automatically stopping and restarting a resident process which is leaking.

【0010】[0010]

【発明の実施の形態】以下、本発明の一実施例について
図面で説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS One embodiment of the present invention will be described below with reference to the drawings.

【0011】図1は本発明によるクライアント・サーバ
システムの構成例であり、クライアント装置14とサー
バ装置10がネットワーク15により接続されている。
クライアント装置14からの要求により処理を行うサー
バプロセス12、サーバプロセス12を監視し、その起
動・停止処理を行う監視プロセス11に加え、サーバプ
ロセス12の状態を管理するための管理テーブル13、
サーバプロセス12が取り得る状態の上限値を格納する
上限値定義テーブル16が存在する。ここでは、クライ
アント装置を1台のみ図示しているが、一般にクライア
ント装置は複数であり、またサーバ装置では複数のサー
ビスが提供される。さらに各サービス毎に同一のサービ
スを提供するサーバプロセスが複数起動され、これらの
全サーバプロセスが監視対象となる。
FIG. 1 shows an example of the configuration of a client-server system according to the present invention. A client device 14 and a server device 10 are connected by a network 15.
A management table 13 for managing a state of the server process 12 in addition to a server process 12 for performing processing in response to a request from the client device 14, a monitoring process 11 for monitoring and starting and stopping the server process 12,
There is an upper limit value definition table 16 that stores an upper limit of a state that the server process 12 can take. Here, only one client device is shown, but generally there are a plurality of client devices, and a server device provides a plurality of services. Further, a plurality of server processes that provide the same service are activated for each service, and all the server processes are monitored.

【0012】図2は管理テーブル13の構成例を示した
もので、監視プロセス11が監視対象としているサーバ
プロセス毎に、サーバプロセスのプロセス番号20、サ
ーバ装置が提供する各種サービスのうちそのサーバプロ
セスがどのサービスを提供するのかを識別するサービス
種別30、サーバプロセスが現在実行中の処理の数を示
す実行カウンタ22、サーバプロセスが現在までに実行
した処理の累計を示す累積カウンタ23、サーバプロセ
スが起動した時刻を示す起動時刻24、サーバプロセス
に対して監視プロセスが停止を要求する際にセットする
終了要求フラグ25を一組の情報として保持する。
FIG. 2 shows an example of the configuration of the management table 13. For each server process monitored by the monitoring process 11, the process number 20 of the server process and the server process among various services provided by the server device are shown. A service type 30 for identifying which service is provided, an execution counter 22 for indicating the number of processes currently being executed by the server process, an accumulation counter 23 for indicating the total number of processes executed by the server process up to now, A start time 24 indicating the start time and an end request flag 25 set when the monitoring process requests the server process to stop the server process are held as a set of information.

【0013】ここで、終了要求フラグには、例えばサー
バプロセスの終了を要求する場合は”1”、要求しない
場合は”0”を設定する。また、本実施例ではサーバプ
ロセスがマルチスレッドで動作し、同時に複数のクライ
アントからの要求を処理する場合を想定している。
The termination request flag is set to "1" when requesting termination of the server process, and "0" when not requesting termination. Further, in this embodiment, it is assumed that the server process operates in a multi-thread and simultaneously processes requests from a plurality of clients.

【0014】図3は上限値定義テーブル16の構成例を
示したもので、サービス種別毎に、そのサービスを提供
するサーバプロセスが占有可能なメモリの上限値を示す
メモリ占有量31、サーバプロセスが連続して動作可能
な時間を示す稼働時間32、サーバプロセスが連続して
処理可能なリクエストの数を示す処理数33を一組の情
報として保持する。サーバプロセスがこれらの上限値の
いずれかを超過した場合に、監視プロセス11がサーバ
プロセスを再起動させる。
FIG. 3 shows an example of the configuration of the upper limit value definition table 16. For each service type, a memory occupation amount 31 indicating the upper limit of the memory that can be occupied by the server process that provides the service, An operation time 32 indicating a continuously operable time and a processing number 33 indicating the number of requests that can be continuously processed by the server process are held as a set of information. If the server process exceeds any of these upper limits, the monitoring process 11 restarts the server process.

【0015】図4は本発明における監視プロセスの処理
フローの例である。ここでは、監視対象のプロセスが1
つの場合を想定している。サービス提供者はサービス種
別毎に、 ・メモリ占有量:サーバプロセスが占有するメモリ容量
が一定値を超えると自動的に再起動する ・稼動時間:サーバプロセスが一定時間動作した後に自
動的に再起動する ・処理数:サーバプロセスが一定数のリクエストを処理
した後に自動的に再起動する の各上限値を定義し、監視プロセス11を開始する。監
視プロセス11は定義された上限値をサービス種別毎に
上限値定義テーブル16に格納(ステップ400)し、
サーバプロセス12の起動(ステップ401)、管理テ
ーブルの初期化(ステップ402)を行い、サーバプロ
セスの監視を開始する。
FIG. 4 shows an example of a processing flow of a monitoring process according to the present invention. Here, the process to be monitored is 1
Two cases are assumed. For each service type, the service provider:-Memory occupancy: automatically restarts when the memory capacity occupied by the server process exceeds a certain value.-Operating time: restarts automatically after the server process has run for a certain time. Yes-Number of processes: Defines the upper limit of "Restart automatically after the server process processes a certain number of requests" and starts the monitoring process 11. The monitoring process 11 stores the defined upper limit value in the upper limit value definition table 16 for each service type (step 400),
The server process 12 is started (Step 401), the management table is initialized (Step 402), and monitoring of the server process is started.

【0016】管理テーブルには、起動したサーバプロセ
スのプロセス番号とサーバ種別、起動時刻を書き込み、
実行カウンタ、累積カウンタ、終了要求フラグをそれぞ
れ”0”に初期化する。監視プロセス11は、監視開始
から監視終了までの間、定期的にサーバプロセス12お
よび管理テーブル13をチェックする。
In the management table, the process number of the started server process, the server type, and the start time are written.
The execution counter, the accumulation counter, and the end request flag are each initialized to “0”. The monitoring process 11 periodically checks the server process 12 and the management table 13 from the start of monitoring to the end of monitoring.

【0017】まずサーバプロセス12の起動状態をチェ
ック(ステップ403)し、停止している場合は管理テ
ーブル13からサーバプロセス12の情報を削除(ステ
ップ404)した後に同種のサービスを行う(つまりサ
ービス種別が同じ)プロセスを起動(ステップ401)
し、監視を続行する。また管理テーブル13からサービ
ス種別21を取得し、上限値定義テーブル16の同じサ
ービス種別のエントリからサーバプロセス12の各種上
限値を参照し、現在のサーバプロセス12の状態と比較
する。
First, the activation status of the server process 12 is checked (step 403). If the server process 12 is stopped, the information of the server process 12 is deleted from the management table 13 (step 404), and the same type of service is performed (that is, the service type). Start the process (Step 401)
And continue monitoring. Further, the service type 21 is acquired from the management table 13, the upper limit value of the server process 12 is referred to from the entry of the same service type in the upper limit value definition table 16, and is compared with the current state of the server process 12.

【0018】その結果が、 ・サーバプロセス12の占有メモリ容量が定義した占有
メモリ容量の限界値を越えている(ステップ405)。
The result is that the occupied memory capacity of the server process 12 exceeds the defined occupied memory capacity limit (step 405).

【0019】・管理テーブル13中の起動時刻24から
現在時刻までの経過時間が定義した連続実行時間の限界
値を超えている(ステップ406)。
The elapsed time from the start time 24 to the current time in the management table 13 exceeds the defined continuous execution time limit (step 406).

【0020】・管理テーブル13中の累積カウンタ23
が定義した累積処理数の限界値を超えている(ステップ
407)。
A cumulative counter 23 in the management table 13
Exceeds the limit value of the cumulative number of processes defined (step 407).

【0021】のいずれかに該当するか、監視プロセス1
1の終了をサービス提供者から要求されている(ステッ
プ408)場合は、管理テーブル13中の実行カウンタ
22をチェック(ステップ409)し、”0”以外が設
定されている(リクエストを処理中)場合は管理テーブ
ル13中の終了要求フラグ25に”1”を設定してサー
バプロセスの監視を続行する(ステップ410)。
Monitoring process 1
If the end of 1 is requested by the service provider (step 408), the execution counter 22 in the management table 13 is checked (step 409), and a value other than "0" is set (request is being processed). In this case, "1" is set to the end request flag 25 in the management table 13, and monitoring of the server process is continued (step 410).

【0022】実行カウンタ22に”0”が設定されてい
る場合はサーバプロセス12を停止(ステップ411)
し、さらに監視プロセス11の終了をサービス提供者か
ら要求されていれば(ステップ412)監視プロセス1
1を終了(ステップ413)し、要求されていなければ
サーバプロセスの監視を続行する。
If "0" is set in the execution counter 22, the server process 12 is stopped (step 411).
If the service provider requests that the monitoring process 11 be terminated (step 412), the monitoring process 1
1 (step 413), and if not requested, monitoring of the server process is continued.

【0023】図5は本発明におけるサーバプロセスの処
理フローの例である。サーバプロセスはサービスを開始
し、クライアントからのリクエストを受信する(ステッ
プ502)と、スレッド生成処理(ステップ503)を
行う。生成されたスレッドは、まず自プロセスのプロセ
ス番号を管理テーブル13から探す。
FIG. 5 shows an example of the processing flow of the server process in the present invention. The server process starts a service, and upon receiving a request from a client (step 502), performs a thread generation process (step 503). The created thread first searches for the process number of its own process from the management table 13.

【0024】以下、管理テーブル13の参照・更新は全
て自プロセスのエントリに対するものである。次に管理
テーブル13中の終了要求フラグ25をチェックする
(ステップ504)。終了要求フラグ25がセットされ
ている場合は、リクエストを拒否(ステップ512)
し、さらに管理テーブル13中の実行カウンタ22が”
0”であれば、プロセスを終了(ステップ511)、
非”0”であれば、スレッド終了処理(ステップ50
9)を行う。
Hereinafter, all references and updates of the management table 13 are made to entries of the own process. Next, the end request flag 25 in the management table 13 is checked (step 504). If the end request flag 25 is set, the request is rejected (step 512).
Then, the execution counter 22 in the management table 13 is changed to "
If "0", the process ends (step 511),
If it is not "0", the thread end processing (step 50)
Perform 9).

【0025】終了要求フラグ25がセットされていない
場合は、管理テーブル13中の実行カウンタ22と累積
カウンタ23をそれそれカウントアップ(ステップ50
5)し、リクエストの処理を行う(ステップ506)。
リクエストの処理が終了すると、実行カウンタ22をカ
ウントダウン(ステップ507)し、管理テーブル13
の終了要求フラグ25をチェック(ステップ508)す
る。
If the end request flag 25 is not set, the execution counter 22 and the accumulation counter 23 in the management table 13 are counted up (step 50).
5) Then, the request is processed (step 506).
When the processing of the request is completed, the execution counter 22 is counted down (step 507), and the management table 13
Is checked (step 508).

【0026】終了要求フラグ25がセットされている場
合は、さらに管理テーブル13の実行カウンタ22をチ
ェック(ステップ510)し、”0”であればプロセス
を終了(ステップ511)、”非0”であればスレッド
を終了する(ステップ509)。終了要求フラグ25が
セットされていない場合は、スレッドを終了する(ステ
ップ509)。
If the end request flag 25 is set, the execution counter 22 of the management table 13 is further checked (step 510). If "0", the process is ended (step 511). If there is, the thread is terminated (step 509). If the end request flag 25 has not been set, the thread is ended (step 509).

【0027】本実施例によれば、サーバプロセスがメモ
リリークを起こしていても占有メモリ容量が定義値を超
えた時点で再起動されて不要なメモリが解放される。ま
た、メモリ以外のコンピュータ資源のリークに関しても
定期的にサーバが再起動されるため、不要な資源が解放
される。以上により、システムの異常終了を防ぐことが
できる。
According to this embodiment, even if the server process has a memory leak, it is restarted when the occupied memory capacity exceeds the defined value, and unnecessary memory is released. In addition, the server is periodically restarted with respect to the leak of computer resources other than the memory, so that unnecessary resources are released. As described above, abnormal termination of the system can be prevented.

【0028】[0028]

【発明の効果】本発明によれば、常駐プロセスがリーク
を起こしていても、適当な間隔で再起動されるため、不
要な占有資源の解放が行われる効果がある。
According to the present invention, even if a resident process has leaked, it is restarted at an appropriate interval, so that there is an effect that unnecessary occupied resources are released.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明によるクライアント/サーバシステムの
構成例を示す図である。
FIG. 1 is a diagram showing a configuration example of a client / server system according to the present invention.

【図2】管理テーブルの内容の一例を示す図である。FIG. 2 is a diagram showing an example of the contents of a management table.

【図3】上限値定義テーブルの内容の一例を示す図であ
る。
FIG. 3 is a diagram showing an example of the contents of an upper limit value definition table.

【図4】サーバ装置内でサーバプロセスを管理するプロ
グラムの処理内容を示すフローチャートである。
FIG. 4 is a flowchart showing processing contents of a program for managing a server process in the server device.

【図5】サーバ装置内でクライアントにサービスを提供
するサーバプロセスの処理内容を示すフローチャートで
ある。
FIG. 5 is a flowchart showing processing contents of a server process for providing a service to a client in the server device.

【符号の説明】[Explanation of symbols]

10…サーバ装置、11…監視プロセス、12…サーバ
プロセス、13…管理テーブル、14…クライアント装
置、15…ネットワーク、16…上限値定義テーブル。
10 server device, 11 monitoring process, 12 server process, 13 management table, 14 client device, 15 network, 16 upper limit value definition table.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】システムから取得したコンピュータ資源を
不要になった後も解放していない常駐プロセスに対し、
このプロセスが占有している資源の量が指定値を超えた
場合、常駐プロセスの起動からの経過時間が指定値を超
えた場合、および実行終了した処理の数が指定された限
界値を超えた場合に常駐プロセスを一旦終了させ、再び
起動することにより常駐プロセスの持つ不要なコンピュ
ータ資源を解放することを特徴とするプロセスの管理方
式。
A resident process that does not release computer resources acquired from the system after it is no longer needed.
The amount of resources occupied by this process has exceeded the specified value, the elapsed time since the start of the resident process has exceeded the specified value, and the number of processes that have completed execution has exceeded the specified limit A process management method characterized in that a resident process is temporarily terminated and then restarted to release unnecessary computer resources of the resident process.
JP11025791A 1999-02-03 1999-02-03 Process management system Pending JP2000222227A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11025791A JP2000222227A (en) 1999-02-03 1999-02-03 Process management system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11025791A JP2000222227A (en) 1999-02-03 1999-02-03 Process management system

Publications (1)

Publication Number Publication Date
JP2000222227A true JP2000222227A (en) 2000-08-11

Family

ID=12175669

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11025791A Pending JP2000222227A (en) 1999-02-03 1999-02-03 Process management system

Country Status (1)

Country Link
JP (1) JP2000222227A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006103814A1 (en) * 2005-03-28 2006-10-05 Mitsubishi Denki Kabushiki Kaisha Application management device and storage medium containing its software
JP2010146382A (en) * 2008-12-19 2010-07-01 Nec Corp Load balancing system, load balancing method and load balancing program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006103814A1 (en) * 2005-03-28 2006-10-05 Mitsubishi Denki Kabushiki Kaisha Application management device and storage medium containing its software
US8601493B2 (en) 2005-03-28 2013-12-03 Mitsubishi Electric Corporation Application controlling apparatus and storage medium which stores software for the apparatus
JP2010146382A (en) * 2008-12-19 2010-07-01 Nec Corp Load balancing system, load balancing method and load balancing program

Similar Documents

Publication Publication Date Title
US5819019A (en) System/method for recovering network resources in a distributed environment, via registered callbacks
US8327375B2 (en) System and method for supporting resource enlistment synchronization
US20010010052A1 (en) Method for controlling multithreading
US20080134182A1 (en) Computer readable storage medium for protection against interleaving transactions using a transaction manager
US5640604A (en) Buffer reallocation system
JP2007115246A (en) Method and apparatus for dynamically allocating resource used by software
JPH0576654B2 (en)
US5901334A (en) System for calculating expected length of time in transient queue by a formula in the event items cannot be allocated to the buffer
CN109361542A (en) The fault handling method of client, device, system, terminal and server
US20070265976A1 (en) License distribution in a packet data network
CN114675957B (en) Plug-in fusing method and device, terminal equipment and computer readable storage medium
CN111949368A (en) Application program control method and device
WO2022095862A1 (en) Thread priority adjusting method, terminal, and computer readable storage medium
JP2000222227A (en) Process management system
CN112068960A (en) CPU resource allocation method, device, storage medium and equipment
US6990608B2 (en) Method for handling node failures and reloads in a fault tolerant clustered database supporting transaction registration and fault-in logic
CN115269136A (en) Heterogeneous multi-core platform partition operating system safety scheduling method and system
JP2000155695A (en) Qos controller, qos controlling method and storage medium
JP2004213122A (en) Stable operation method of control system by client/server and program therefor
JP3839259B2 (en) Multithread control method, multithread control apparatus, recording medium, and program
JPH08263325A (en) Server processor and intra-server fault detection device and method
US7788529B2 (en) Method for safely interrupting blocked work in a server
JP2001195271A (en) Method and device for generating and deciding distributed object server thread
JP2001034489A (en) Method for executing and controlling object-oriented program execution environment
KR20010041175A (en) Method, apparatus, and product for leasing of group membership in a distributed system