JP2000200210A - Memory managing device - Google Patents

Memory managing device

Info

Publication number
JP2000200210A
JP2000200210A JP11000471A JP47199A JP2000200210A JP 2000200210 A JP2000200210 A JP 2000200210A JP 11000471 A JP11000471 A JP 11000471A JP 47199 A JP47199 A JP 47199A JP 2000200210 A JP2000200210 A JP 2000200210A
Authority
JP
Japan
Prior art keywords
memory
address
link list
data
control unit
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
JP11000471A
Other languages
Japanese (ja)
Inventor
Takashi Yoshida
吉田  隆
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.)
NEC Engineering Ltd
Original Assignee
NEC Engineering 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 NEC Engineering Ltd filed Critical NEC Engineering Ltd
Priority to JP11000471A priority Critical patent/JP2000200210A/en
Publication of JP2000200210A publication Critical patent/JP2000200210A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a memory managing device, which is suitable for a data processing method for a dynamically managed memory and easily detects and avoids a memory leak, for a packet exchanger, a router device or the like. SOLUTION: The memory managing device comprises a data memory 3 composed of a RAM or the like, a link list memory 5, and an address control part 4 arranged and connected to between both the memories 3 and 5. The address control part 4 has a free area management part 41, a use area management part 42, and an address/link list control part 43.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、コンピュータ等の
メモリ(記憶装置)のメモリリークを検出/回避するメ
モリ管理装置に関する。
[0001] 1. Field of the Invention [0002] The present invention relates to a memory management device for detecting / avoiding a memory leak in a memory (storage device) such as a computer.

【0002】[0002]

【従来の技術】従来、メモリリークの検出/回避を行う
メモリ管理装置は、コンピュータにおいて、メモリの不
必要な割当てを検出する為等に広く使用されている。
2. Description of the Related Art Conventionally, a memory management device for detecting / avoiding a memory leak has been widely used in a computer for detecting unnecessary allocation of memory.

【0003】斯るメモリ管理装置又は方法の従来例は、
例えば、特開平9−244948号公報の「メモリリー
クの検出方法と装置」等に開示されている。斯る従来例
にあっては、メモリの割当や解除を追跡するメモリ割当
テーブルに、ファイル名とライン番号に加えて、対応す
るメモリ割当がイベントの出現の前に割当解除されてい
るべきであることを示す満了イベントと、メモリの現在
の割当を示す従属ポインタを含む割当解除情報を記憶す
ることにより、メモリリークの検出を行う。
A conventional example of such a memory management device or method is as follows.
For example, it is disclosed in “Method and Apparatus for Detecting Memory Leak” in JP-A-9-244948. In such a conventional example, in addition to the file name and line number, the corresponding memory allocation should be deallocated before the appearance of the event in the memory allocation table that tracks the allocation and release of the memory. A memory leak is detected by storing an expiration event indicating that the information has expired, and allocation release information including a dependent pointer indicating the current allocation of the memory.

【0004】[0004]

【発明が解決しようとする課題】しかし、従来のメモリ
管理装置や方法は、複雑且つ大規模となることが問題で
ある。これは、メモリリークを検出する従来システムに
あっては、コンピュータのメモリがオペレーティングシ
ステム(OS)により、プログラム、つまり特定の機能
の為に使用する複数のプロセスに動的に割当られ、各プ
ロセスが完了した際に、割当解除されない場合を検出す
ることを目的としている為である。
However, there is a problem that the conventional memory management device and method are complicated and large-scale. This is because, in a conventional system for detecting a memory leak, the memory of a computer is dynamically allocated by an operating system (OS) to a program, that is, a plurality of processes used for a specific function. This is because the purpose is to detect a case where the assignment is not canceled when the assignment is completed.

【0005】換言すると、コンピュータのメモリ割当
と、その解除の時間間隔は、各プロセスの処理時間によ
るものである。各プロセスの処理時間は、その処理内容
によって、例えば、極めて短時間で処理されるプロセス
や、コンピュータが動作している間中必要なプロセスが
ある為に、一概に定められるものではない。そのに為
に、有効なプロセスに割当てられているメモリ領域と、
無効なプロセスに割当てられているメモリ領域の判別、
つまり、メモリリークの検出の目的で、プロセスに対応
するファイル情報、メモリの現在割当てられたブロック
に関する情報及び割当解除情報を管理する手段が必要で
ある。
[0005] In other words, the time interval between the memory allocation of the computer and its release depends on the processing time of each process. The processing time of each process is not unequivocally determined because, for example, there are processes that are processed in an extremely short time and processes that are required while the computer is operating, depending on the processing contents. For that purpose, the memory area allocated to the valid process,
Determining the memory area allocated to the invalid process,
In other words, for the purpose of detecting a memory leak, a means for managing file information corresponding to a process, information on a currently allocated block of a memory, and allocation release information is required.

【0006】そこで、本発明の目的は、パケット交換装
置やルータ装置において、そのデータ処理に適応した簡
単なメモリ管理装置を提供することにある。
An object of the present invention is to provide a simple memory management device adapted to data processing in a packet switching device or a router device.

【0007】本発明の他の目的は、メモリの不必要な割
当により使用不能メモリ領域が拡大することによるデー
タ処理能力の低下を阻止/回避するメモリ管理装置を提
供することにある。
It is another object of the present invention to provide a memory management device which prevents / avoids a reduction in data processing capacity due to an increase in an unusable memory area due to unnecessary allocation of memory.

【0008】[0008]

【課題を解決するための手段】前述の課題を解決するた
めに、本発明によるメモリ管理装置は、次のような特徴
的な構成を備えている。
To solve the above-mentioned problems, a memory management device according to the present invention has the following characteristic configuration.

【0009】(1)入力データを書込要求信号に基づき
格納し、読出要求信号に基づき出力データとして読出す
データメモリと、前記入力データの各パケットのリンク
リストと前記データメモリ空き領域のリンクリストを格
納するリンクリストメモリと、前記データメモリ及び前
記リンクリストメモリ間に接続され、前記データメモリ
へのアドレスを生成するアドレス制御部とを備えるメモ
リ管理装置。
(1) A data memory for storing input data based on a write request signal and reading it as output data based on a read request signal, a link list of each packet of the input data, and a link list of the free area of the data memory A memory management device comprising: a link list memory for storing an address; and an address control unit connected between the data memory and the link list memory for generating an address to the data memory.

【0010】(2)前記アドレス制御部は、書込アドレ
ス情報を出力する空き領域管理部、使用領域管理部及び
前記空き領域及び使用領域管理部に接続されるアドレス
/リンクリスト制御部を有する上記(1)のメモリ管理
装置。
(2) The address control section has a free area management section for outputting write address information, a use area management section, and an address / link list control section connected to the free area and use area management section. (1) The memory management device.

【0011】(3)前記空き領域管理部は、前記データ
メモリの空き領域先頭アドレスを保持する先頭アドレス
管理部及び前記空き領域末尾アドレスを保持する末尾ア
ドレス管理部を有する上記(2)のメモリ管理装置。
(3) The memory management according to (2), wherein the free area management unit has a head address management unit that holds a free area head address of the data memory and a tail address management unit that holds the free area tail address. apparatus.

【0012】(4)前記使用領域管理部は、設定された
一定時間をカウントするカウンタ及び論理回路により構
成される未開放アドレスビット処理部を有する上記
(2)又は(3)のメモリ管理装置。
(4) The memory management device according to (2) or (3), wherein the used area management unit has an unreleased address bit processing unit configured by a counter that counts a set fixed time and a logic circuit.

【0013】(5)前記アドレス/リンクリスト制御部
は、ダウンカウンタ及び初期値設定回路を含むページ数
管理部、アドレス生成用リンクリストメモリアドレス制
御部及びリンクリストメモリデータ処理部を有する上記
(2)、(3)又は(4)のメモリ管理装置。
(5) The address / link list control unit includes a page number management unit including a down counter and an initial value setting circuit, an address generation link list memory address control unit, and a link list memory data processing unit. ), (3) or (4).

【0014】[0014]

【発明の実施の形態】以下、本発明によるメモリ管理装
置の好適実施形態例の構成及び動作を、添付図を参照し
て詳細に説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The configuration and operation of a preferred embodiment of a memory management device according to the present invention will be described below in detail with reference to the accompanying drawings.

【0015】先ず、図1を参照して、本発明によるメモ
リ管理装置を含むパケット交換装置の全体システム構成
を説明する。このシステムは、複数の通信回線に接続さ
れた入力データ処理部2、メモリ管理装置1、出力要求
制御部6、ルート検索処理部7、スイッチ制御部8、出
力データ処理部9より構成され、出力データ処理部9の
出力は、通信回線に送出される。ここで、メモリ管理装
置1は、データメモリ3、アドレス制御部4及びリンク
リスト(連鎖情報)メモリ5より構成される。
First, an overall system configuration of a packet switching device including a memory management device according to the present invention will be described with reference to FIG. This system comprises an input data processing unit 2, a memory management device 1, an output request control unit 6, a route search processing unit 7, a switch control unit 8, and an output data processing unit 9 connected to a plurality of communication lines. The output of the data processing unit 9 is sent to a communication line. Here, the memory management device 1 includes a data memory 3, an address control unit 4, and a link list (chain information) memory 5.

【0016】図1のシステムにあっては、入力データ処
理部2は、複数の通信回線からのパケットを、夫々独立
して高速にスイッチングする為に、パケット毎に装置内
固有の単位(ページ)に分割し、又各パケットの処理方
法を決定する為の属性を生成する。出力要求制御部6
は、入力データ処理部2で生成されたパケット毎の属性
により、スイッチングの為の出力要求を制御する。
In the system shown in FIG. 1, the input data processing unit 2 is a unit (page) unique to the apparatus for each packet in order to independently and quickly switch packets from a plurality of communication lines. , And an attribute for determining a processing method of each packet is generated. Output request control unit 6
Controls the output request for switching based on the attribute of each packet generated by the input data processing unit 2.

【0017】ルート検索処理部7は、出力要求制御部6
の出力要求に対し、出力先を決定してスイッチの制御を
行い、出力要求元のページに分割されたパケットをデー
タメモリから読出す情報を生成する。メモリ管理装置1
は、上述の如く分割されたページを格納し、必要なとき
に読出されるデータメモリ3を有し、後述する如くこれ
を適切に制御する。
The route search processing unit 7 includes an output request control unit 6
In response to the output request, the output destination is determined, the switch is controlled, and information for reading the packet divided into the page of the output request source from the data memory is generated. Memory management device 1
Has a data memory 3 for storing the divided pages as described above and reading them out when necessary, and appropriately controlling them as described later.

【0018】スイッチ制御部8は、データメモリ3から
読出されたページを、ルート検索処理部7により決定さ
れた通りの宛先へスイッチングする。出力データ処理部
9は、スイッチ制御部8によりスイッチングされたペー
ジに分割されたパケットデータを、出力通信回線のフォ
ーマットに適合する如く再組立されて出力する。
The switch control unit 8 switches the page read from the data memory 3 to the destination determined by the route search processing unit 7. The output data processing unit 9 reassembles the packet data divided into pages switched by the switch control unit 8 so as to conform to the format of the output communication line and outputs the reassembled packet data.

【0019】メモリ管理装置1について、更に説明を補
足する。メモリ管理装置1のデータメモリ3は、入力デ
ータ処理部2からのデータを、アドレス制御部4が生成
するアドレスに格納し、ルート検索処理部7からの読出
要求により、アドレス制御部4が生成したアドレスのデ
ータを、スイッチ制御部8へ出力する。
The memory management device 1 will be further described. The data memory 3 of the memory management device 1 stores the data from the input data processing unit 2 at the address generated by the address control unit 4 and generates the data from the address control unit 4 in response to a read request from the route search processing unit 7. The address data is output to the switch control unit 8.

【0020】アドレス制御部4は、入力データ処理部2
からの書込要求とルート検索処理部7からの読出要求か
らデータメモリ3への書込アドレス及び読出アドレスを
生成する。そして、パケット単位のページリンクの為
に、各パケットのリンクリストとデータメモリ3の空き
領域のリンクリストを格納するリンクリストメモリ5を
管理する。また、何らかの理由により、データメモリ3
に書込まれたデータを読出す為のルート検索処理部7か
らの読出要求が誤り、データメモリ3から読出される筈
のページが読出されず不必要な領域を持った場合には、
これを開放するメモリリーク回避機能を有する。この詳
細については、後述することとする。
The address control unit 4 includes the input data processing unit 2
A write address and a read address to the data memory 3 are generated from a write request from the CPU and a read request from the route search processing unit. Then, a link list memory 5 that stores a link list of each packet and a link list of a free area of the data memory 3 is managed for a page link in a packet unit. For some reason, the data memory 3
If the read request from the route search processing unit 7 for reading the data written in the data memory is incorrect and the page to be read from the data memory 3 is not read and has an unnecessary area,
It has a memory leak avoidance function to release this. The details will be described later.

【0021】次に、図2を参照して、図1のメモリ管理
装置1、特にその中のアドレス制御部4の詳細構成を説
明する。このアドレス制御部4は、空き領域管理部4
1、使用領域管理部42及びアドレス/リンクリスト制
御部43から構成される。アドレス/リンクリスト制御
部43は、書込要求と読出要求とを受け、空き領域管理
部41及び使用領域管理部42に相互接続されると共
に、データメモリ3及びリンクリストメモリ5に接続さ
れている。空き領域管理部41からは、書込アドレス情
報が出力される。
Next, with reference to FIG. 2, a detailed configuration of the memory management device 1 of FIG. 1, particularly, the address control unit 4 therein will be described. The address control unit 4 includes a free area management unit 4
1. It comprises a use area management unit 42 and an address / link list control unit 43. The address / link list control unit 43 receives the write request and the read request, is interconnected with the free area management unit 41 and the use area management unit 42, and is also connected with the data memory 3 and the link list memory 5. . The free area management unit 41 outputs write address information.

【0022】ここで、空き領域管理部41は、リンクリ
ストメモリ5の空き領域リンクリストの内、データメモ
リ3における空き領域の先頭アドレス情報と末尾アドレ
ス情報の記憶手段を含み、データメモリ3への書き込み
アドレスを、リンクリストメモリ5から検索するため
に、空き領域の先頭アドレス情報をアドレス/リンクリ
スト制御部43へ出力する。また、この空き領域の先頭
アドレス情報は、出力要求制御部6へも出力される。
Here, the free area management unit 41 includes storage means for storing the start address information and the end address information of the free area in the data memory 3 in the free area link list of the link list memory 5. In order to search the write address from the link list memory 5, the head address information of the free area is output to the address / link list control unit 43. Further, the head address information of the empty area is also output to the output request control unit 6.

【0023】アドレス/リンクリスト制御部43は、受
け取ったリンクリストメモリ5の空き領域で始まる空き
領域のアドレスを、データメモリ3への書き込みアドレ
スとしてリンクリストメモリから読み出し、データメモ
リへ出力する手段と、この時、新しい空き領域先頭アド
レスを、リンクリストメモリより読み出し、空き領域管
理部41の空き領域先頭アドレス情報を更新する手段
と、読み出し要求に含まれる、読み出されるパケットの
先頭ページアドレス情報を、読み出しアドレスとして、
データメモリ3に渡し、もしそれに続くページがある場
合は、リンクリストメモリ5の対応するリンクリストを
読み出しデータメモリ3へ出力する手段と、パケットの
すべてのページが読み出されると、そのパケットのリン
クリストを空き領域管理部の末尾アドレス情報に追加す
ることによって、再びその領域を空き領域に設定する手
段を有す。
The address / link list control unit 43 reads the address of the received free area starting from the free area of the link list memory 5 from the link list memory as a write address to the data memory 3 and outputs the read address to the data memory. At this time, a means for reading a new free area start address from the link list memory and updating the free area start address information of the free area management unit 41 and a first page address information of the read packet included in the read request, As a read address,
Means for passing the data to the data memory 3 and, if there is a subsequent page, reading the corresponding link list in the link list memory 5 and outputting it to the data memory 3; and when all the pages of the packet are read, the link list of the packet is read. Is added to the end address information of the free area management unit, so that the area is set as a free area again.

【0024】使用領域管理部42は、一定時間のうち一
度も空き領域に割り当てられなかったリンクリストメモ
リのアドレスを識別できるように、設定される一定時間
をカウントするカウンタと、リンクリストメモリ5へ書
き込むための、未開放アドレス表示ビットを管理する手
段と、一定時間毎にリンクリストメモリ5の内容を読
み、未開放アドレス表示ビットを認識すると、そのアド
レスをメモリリーク領域と判断する手段を有す。
The use area management section 42 stores a counter for counting a set fixed time and a link list memory 5 so as to identify an address of the link list memory which has not been allocated to the free area at least once in the fixed time. There are means for managing the unreleased address display bits for writing, and means for reading the contents of the link list memory 5 at regular time intervals and recognizing the unreleased address display bits to determine the address as a memory leak area. .

【0025】次に、図3は、図2のアドレス制御部4の
詳細ブロック図である。図3において、空き領域管理部
41で、データメモリの空き領域先頭アドレスを保持す
る、先頭アドレス管理部11と、空き領域末尾アドレス
を保持する、末尾アドレス管理部12は、フリップフロ
ップ(FF)から構成されるレジスタである。使用領域
管理部42は、設定された一定時間を、装置内クロック
によってカウントするカウンタ21と、論理回路によっ
て構成される未開放アドレスビット処理部22で構成さ
れる。
FIG. 3 is a detailed block diagram of the address control unit 4 of FIG. In FIG. 3, a free area management unit 41 holds a free area start address of a data memory, and a start address management unit 11 that holds a free area end address. The register to be configured. The used area management unit 42 includes a counter 21 that counts a set fixed time by an internal clock, and an unaddressed address bit processing unit 22 configured by a logic circuit.

【0026】アドレス/リンクリスト制御部43は、ダ
ウンカウンタと初期値セット用の論理回路などによって
構成されるページ数管理部31と、アドレス生成用のカ
ウンタと論理回路などによって構成されるリンクリスト
メモリアドレス制御部32と、論理回路などによって構
成されるリンクリストメモリデータ処理部33によって
構成される。
The address / link list control unit 43 includes a page number management unit 31 including a down counter and a logic circuit for setting an initial value, and a link list memory including a counter and a logic circuit for generating an address. It is composed of an address control unit 32 and a link list memory data processing unit 33 composed of a logic circuit and the like.

【0027】以下、本発明によるメモリ管理装置の好適
実施形態例の動作を説明する。先ず、図1のシステムの
動作を説明する。尚、図1及び図2のデータメモリ3
は、RAM(ランダムアクセスメモリ)であり、リンク
リストメモリ5は、デュアルポートメモリ(DPM)で
あるものとする。
The operation of the preferred embodiment of the memory management device according to the present invention will be described below. First, the operation of the system shown in FIG. 1 will be described. The data memory 3 shown in FIGS.
Is a RAM (random access memory), and the link list memory 5 is a dual port memory (DPM).

【0028】図1のシステムでは、複数の通信回線を備
え、それぞれから複数のパケットが入力される。そこで
まず、各パケットは、入力データ処理部2において、装
置内固有のデータ長(ページ)に分割され、次段へ渡す
ためにパケット毎に多重化される。
In the system shown in FIG. 1, a plurality of communication lines are provided, and a plurality of packets are input from each of the plurality of communication lines. Therefore, first, each packet is divided by the input data processing unit 2 into a data length (page) unique to the apparatus, and is multiplexed for each packet in order to be passed to the next stage.

【0029】次に、各パケットのパケット長や宛先など
を含む属性データを作成し、それを出力要求制御部6へ
出力する。同時に、宛先を決定するためのルート検索処
理と、スイッチングのための処理時間の間、データを待
機させておくために格納するデータメモリ3へ送出し、
書き込むアドレスを得るために、アドレス制御部4へ書
き込み要求として、パケットのページ数を含むデータを
送出し、データメモリ3のアドレス制御部4から指定さ
れる書き込みアドレスへ、各パケットのページが格納さ
れる。このとき、リンクリストメモリ5には、各パケッ
ト毎のページが、データメモリのどのアドレスに格納さ
れたかの、リンクリスト情報が書き込まれる。
Next, attribute data including the packet length and the destination of each packet is created and output to the output request control unit 6. At the same time, during a route search process for determining a destination and a processing time for switching, the data is sent to a data memory 3 for storing the data in a standby state,
In order to obtain the write address, data including the number of pages of the packet is transmitted as a write request to the address control unit 4, and the page of each packet is stored in the write address specified by the address control unit 4 of the data memory 3. You. At this time, in the link list memory 5, link list information indicating at which address in the data memory the page for each packet is stored.

【0030】続いて、パケットを、要求される正しい宛
先へスイッチングする情報として、出力要求制御部に渡
されたパケットの属性情報と、データメモリへのパケッ
トの最初のページの書き込みアドレスを、ルート検索処
理部7へ渡す。ルート検索処理部7では、設定されたル
ート情報よりスイッチ制御情報をスイッチ制御部8へ渡
し、また、スイッチングするデータ(パケット)を読み
出すために、データメモリに書き込まれているパケット
の最初のページのアドレスを、読み出し要求としてアド
レス制御部4へ渡す。
Subsequently, as information for switching the packet to the required correct destination, the attribute information of the packet passed to the output request control unit and the write address of the first page of the packet in the data memory are searched for a route. Transfer to processing unit 7. The route search processing unit 7 passes the switch control information to the switch control unit 8 based on the set route information, and reads out the data (packet) to be switched so as to read the first page of the packet written in the data memory. The address is passed to the address control unit 4 as a read request.

【0031】アドレス制御部4では、受け取ったアドレ
スと、リンクリストメモリ5に書かれている該当パケッ
トのリンクリストより、読み出しアドレスを、データメ
モリ3へ出力する。データメモリ3の該当アドレスから
読み出されたページは、パケット毎に、ルート検索処理
部からの属性と共にスイッチングの情報に従って、スイ
ッチ制御部8にてスイッチングされ、定められた宛先の
出力データ処理部9へ送出される。出力データ処理部9
では、受け取ったページを、属性情報をもとに、パケッ
トの再組み立てを行い、通信回線に適合したデータフォ
ーマットにして送出する。
The address controller 4 outputs a read address to the data memory 3 based on the received address and the link list of the corresponding packet written in the link list memory 5. The page read from the corresponding address in the data memory 3 is switched by the switch control unit 8 in accordance with the switching information together with the attribute from the route search processing unit for each packet, and the output data processing unit 9 of the predetermined destination is determined. Sent to Output data processing unit 9
Then, the received page is reassembled in packets based on the attribute information, and is transmitted in a data format suitable for a communication line.

【0032】この一連の動作の中で、ルート検索処理部
7で処理、生成された読み出し要求が、何らかの理由に
より、正しくアドレス制御部4へ渡されず、データメモ
リ3から読み出されるはずのデータが読み出されず、リ
ンクリストメモリ5に、その情報が残ってしまい、その
後も新しくデータを書き込むアドレスに割り当てられな
い領域が発生することを、メモリリークとしている。
In this series of operations, the read request processed and generated by the route search processing unit 7 is not correctly passed to the address control unit 4 for some reason, and the data to be read from the data memory 3 is deleted. The fact that the information is not read out and remains in the link list memory 5 and an area that cannot be allocated to an address to which data is newly written occurs afterwards is defined as a memory leak.

【0033】ここで、理解を助けるために、具体例を挙
げて説明することとする。例えば、2本の通信回線から
それぞれパケット1とパケット2が入力されると、ま
ず、入力データ処理部2において、装置内固有のデータ
長(ページ)に分割される。ここでは、パケット1のパ
ケット長を28バイトとし、パケット2のパケット長を
20バイトと仮定する。そして、1ページ長は10バイ
トだと仮定すると、パケット1は3ページに分割され、
最後の1ページの余った2バイトにはダミーのデータが
入れられる。パケット2は2ページに分割され、ちょう
どページ長で割り切れるためダミーデータの挿入はな
い。
Here, in order to facilitate understanding, a specific example will be described. For example, when a packet 1 and a packet 2 are input from two communication lines, first, the input data processing unit 2 divides the data into a data length (page) unique to the device. Here, it is assumed that the packet length of the packet 1 is 28 bytes and the packet length of the packet 2 is 20 bytes. And assuming that one page length is 10 bytes, packet 1 is divided into three pages,
The remaining two bytes of the last one page contain dummy data. Packet 2 is divided into two pages, which are exactly divisible by the page length, so that no dummy data is inserted.

【0034】そして、各パケットのパケット長や宛先な
どを含む属性データを作成し、それを出力要求制御部6
へ出力する。同時に、ページへ分割されたパケットをデ
ータメモリ3へ書き込むために、アドレス制御部4へ書
き込み要求として、パケット1であれば、ページ数情報
3を送出し、パケット1のページをデータメモリへ順に
送出する。
Then, attribute data including the packet length and destination of each packet is created, and the created attribute data is output to the output request control unit 6.
Output to At the same time, in order to write the packet divided into pages into the data memory 3, as a write request to the address control unit 4, if the packet is 1, the page number information 3 is transmitted, and the pages of the packet 1 are sequentially transmitted to the data memory. I do.

【0035】次に、図2と図3を参照して、本発明によ
るメモリ管理装置の動作を説明する。アドレス制御部4
では、アドレス/リンクリスト制御部43のページ数管
理部31が受け取った、書き込むページ数である3ペー
ジが、ダウンカウンタの初期値にセットされる。
Next, the operation of the memory management device according to the present invention will be described with reference to FIGS. Address control unit 4
Then, three pages, which are the number of pages to be written, received by the page number management unit 31 of the address / link list control unit 43, are set to the initial value of the down counter.

【0036】リンクリストメモリアドレス制御部32
は、セットされた値の3を見て、3ページ分の空きペー
ジをデータメモリへ書き込むためのアドレスを用意する
ために、空き領域管理部41の先頭アドレス管理部11
から、空き領域の先頭アドレスを受け取り、そのアドレ
スのリンクリストメモリの内容を参照し、同時にページ
数管理部31のダウンカウンタの値を一つ減じる。ま
た、空き領域先頭アドレスは、1ページ目の書き込みア
ドレスとして、データメモリのアドレスへ出力される。
ここで参照された内容は、2ページ目のアドレスとし
て、データメモリの書き込みアドレスへ出力され、その
アドレスのリンクリストメモリの内容を、3ページ目の
書き込みアドレスとして参照する。この時、再びダウン
カウンタの値を、一つ減じる。3ページ目のアドレスを
データメモリの書き込みアドレスへ出力し、そのアドレ
スのリンクリストの内容を参照する。
Link list memory address control unit 32
Looks at the set value of 3, and prepares an address for writing three empty pages into the data memory.
, The head address of the free area is received, the contents of the link list memory at that address are referenced, and at the same time, the value of the down counter of the page number management unit 31 is decremented by one. The free area start address is output to the address of the data memory as the write address of the first page.
The content referred to here is output to the write address of the data memory as the address of the second page, and the content of the link list memory at that address is referred to as the write address of the third page. At this time, the value of the down counter is reduced by one again. The address of the third page is output to the write address of the data memory, and the contents of the link list at that address are referred to.

【0037】ここで再び一つ減じられるダウンカウンタ
の値が、0になったことを、アドレス/リンクリスト制
御部が認識すると、参照された値は、新しい、空き領域
の先頭アドレスとして、先頭アドレス管理部11のレジ
スタに書き込まれる。また同じに、このアドレスに書き
込まれたページが、パケットの最後のページだというこ
とを示すために予約された値である0が、リンクリスト
メモリのリンクリストに書かれる。これで、パケット1
の3ページ分のデータが順に書き込まれる。また、この
時、データメモリへの書き込みアドレスとして読み出さ
れるリンクリストのアドレスのデータには、ある一定時
間の間に空き領域に割り当てられなかったデータメモリ
の領域を識別するための、未開放アドレス表示ビットに
1が書かれる。このビットは、ある一定時間の間は、一
度でも空き領域に割り当てられれば、再度その領域がデ
ータメモリへのページを書き込むアドレスに割り当てら
れても、1を書くことが無いように使用領域管理部42
の未開放アドレスビット処理部により制御される。ま
た、この一定時間は、使用領域管理部42のカウンタ2
1に設定される値であり、設定値は、装置が処理するパ
ケット長とルート検索処理部とスイッチング能力より求
められ、データメモリに、ページが正常に蓄積されてい
る最大の時間を最小値とする1サイクルを、保護のため
に数サイクル取った値とする。また、最初に先頭アドレ
ス管理部11で保持してあった先頭ページアドレスは、
先頭ページの書き込みアドレス情報として出力される。
同様に、パケット2も処理される。
Here, when the address / link list control unit recognizes that the value of the down counter, which is decremented by one again, has become 0, the referenced value is set as the new start address of the free area as the start address. The data is written to the register of the management unit 11. Similarly, 0, which is a reserved value for indicating that the page written at this address is the last page of the packet, is written in the link list of the link list memory. Now packet 1
Are sequentially written. At this time, the data of the address of the link list read as the write address to the data memory includes an unreleased address display for identifying an area of the data memory that has not been allocated to a free area during a certain period of time. 1 is written to the bit. This bit is used so that once it is allocated to an empty area for a certain fixed time, even if that area is allocated to an address for writing a page to the data memory again, it is not written to 1 42
Is controlled by the unreleased address bit processing unit. Also, this fixed time is determined by the counter 2 of the used area management unit 42.
The set value is determined from the packet length to be processed by the device, the route search processing unit, and the switching capability, and the maximum time during which the page is normally stored in the data memory is defined as the minimum value. One cycle is a value obtained by taking several cycles for protection. The first page address initially held by the first address management unit 11 is:
It is output as write address information of the first page.
Similarly, packet 2 is processed.

【0038】図4は、本発明による実施の形態における
リンクリストメモリとデータメモリのアドレスマップで
ある。図4(A)は、ページ分割されたパケットがデー
タメモリに書き込まれる前のリンクリストのアドレスマ
ップを示しており、ここでは、0から9のアドレスの、
全ての領域が空き領域であり、空き領域の先頭アドレス
は2、空き領域の末尾アドレスは9であり、空き領域の
リンクリストは順に、2−3−5−6−8−1−4−7
−9となっている。図4(B)は、パケット1とパケッ
ト2がデータメモリへ書き込まれた後のデータメモリの
アドレスマップを示しており、パケット1の3ページ
と、パケット2の2ページが、先程のリンクリストメモ
リのアドレスマップに示された空き領域の先頭から順に
書き込まれたことを示す。
FIG. 4 is an address map of the link list memory and the data memory in the embodiment according to the present invention. FIG. 4A shows an address map of the link list before the page-divided packet is written to the data memory.
All the areas are free areas, the head address of the free area is 2, the end address of the free area is 9, and the link list of the free area is 2-3-3-5-8-8-4-7 in order.
−9. FIG. 4B shows an address map of the data memory after the packet 1 and the packet 2 are written into the data memory. The three pages of the packet 1 and the two pages of the packet 2 are stored in the link list memory. Indicates that the data is sequentially written from the head of the free area indicated in the address map of FIG.

【0039】図5は、パケット1とパケット2がデータ
メモリに書き込まれた後のリンクリストのアドレスマッ
プである。ここで、パケット1のリンクリストは、アド
レス2−3−5の順になっており、アドレス5の内容に
は、最後のページを示す0が書かれている。同様に、パ
ケット2のリンクリストは、6−8、空き領域のリンク
リストは、1−4−7−9である。
FIG. 5 is an address map of the link list after the packets 1 and 2 have been written to the data memory. Here, the link list of the packet 1 is in the order of the address 2-3-5, and the content of the address 5 contains 0 indicating the last page. Similarly, the link list of the packet 2 is 6-8, and the link list of the empty area is 1-4-7-9.

【0040】パケットを要求される正しい宛先へスイッ
チングするために、出力要求制御部に渡されたパケット
の属性情報と、データメモリへのパケットの最初のペー
ジの書き込みアドレスを、ルート検索処理部7へ渡す。
ルート検索処理部7では、設定されたルート情報よりス
イッチ制御情報をスイッチ制御部8へ渡し、また、スイ
ッチングするデータ(パケット)を読み出すために、デ
ータメモリに書き込まれているパケットの最初のページ
のアドレス、パケット1であればアドレス2を、読み出
し要求としてアドレス制御部4へ渡す。
In order to switch the packet to the required correct destination, the attribute information of the packet passed to the output request control unit and the write address of the first page of the packet in the data memory are sent to the route search processing unit 7. hand over.
The route search processing unit 7 passes the switch control information to the switch control unit 8 based on the set route information, and reads out the data (packet) to be switched so as to read the first page of the packet written in the data memory. If the packet is a packet 1, the address 2 is passed to the address control unit 4 as a read request.

【0041】図2と図3を参照すると、読み出し要求を
受け取ったアドレス/リンクリスト制御部43のアドレ
ス制御部32は、そのアドレスを先頭アドレスとし、リ
ンクリストに格納されているそのパケットのリンク情報
から、最後のページを示す0を認識するまで、データメ
モリ3へ、読み出しアドレスとしてその内容を出力す
る。パケット1の場合に出力される、データメモリの読
み出しアドレスは、2−3−5となり、データメモリか
らは、パケット1の3ページが出力される。この時、読
み出されたアドレスは、読み出し先頭アドレスを、空き
領域管理部41の末尾アドレス管理部12のレジスタが
示すリンクリストメモリの空き領域末尾のデータとして
書かれ、3ページ目のアドレスを新しい空き領域末尾ア
ドレスとして、更新することによって、空き領域に再割
当てされる。また、この時、空き領域に再割当てされた
リンクリストメモリの未開放アドレスビットには0が書
かれる。
Referring to FIGS. 2 and 3, the address control unit 32 of the address / link list control unit 43 that has received the read request sets the address as the top address and stores the link information of the packet stored in the link list. After that, the content is output as a read address to the data memory 3 until 0 indicating the last page is recognized. The read address of the data memory output in the case of the packet 1 is 2-3-5, and three pages of the packet 1 are output from the data memory. At this time, in the read address, the read start address is written as data at the end of the free area of the link list memory indicated by the register of the end address management unit 12 of the free area management unit 41, and the address of the third page is set as the new address. By updating as a free area end address, it is reassigned to a free area. At this time, 0 is written in the unreleased address bits of the link list memory reallocated to the free area.

【0042】データメモリから出力されたページは、パ
ケット毎にルート検索処理部からの属性と共にスイッチ
ングの情報に従って、スイッチ制御部8にてスイッチン
グされ、定められた宛先の出力データ処理部9へ送出さ
れる。出力データ処理部9では、受け取ったページを、
属性情報をもとに、パケットの再組み立てを行い、通信
回線に適合したデータフォーマットにして送出する。
The page output from the data memory is switched by the switch control unit 8 in accordance with the switching information together with the attribute from the route search processing unit for each packet, and is sent to the output data processing unit 9 having a predetermined destination. You. In the output data processing unit 9, the received page is
The packet is reassembled on the basis of the attribute information, and transmitted in a data format suitable for the communication line.

【0043】次に、パケット1と2の他に、新しいパケ
ットが処理されず、パケット1と2が読み出されてしま
っているはずの一定時間後に、パケット2の読み出し要
求が来なかった場合の動作を説明する。
Next, in addition to the packets 1 and 2, when a new packet is not processed, and a packet 2 and a read request are not received after a certain period of time after which the packets 1 and 2 should have been read. The operation will be described.

【0044】図6は、図5のパケット1と2が書き込ま
れている状態の、リンクリストメモリのアドレスマップ
から、パケット1だけが読み出された状態の、リンクリ
ストメモリのアドレスマップである。ここで、パケット
2の読み出し情報が来ず、アドレス6と8が無効な領域
であるとする。アドレス/リンクリスト制御部の、アド
レス制御部32とデータ処理部33は、DPMで構成さ
れたリンクリストメモリの、一方のポートから、使用領
域管理部42のカウンタ21に設定された値により、全
アドレスの未開放アドレス表示ビットを走査している。
FIG. 6 is an address map of the link list memory in a state where only the packet 1 is read from the address map of the link list memory in a state where the packets 1 and 2 of FIG. 5 are written. Here, it is assumed that the read information of the packet 2 does not come and the addresses 6 and 8 are invalid areas. The address control unit 32 and the data processing unit 33 of the address / link list control unit use a value set in the counter 21 of the use area management unit 42 from one port of the link list memory configured by DPM. The unreleased address display bit of the address is being scanned.

【0045】ここで、全アドレスを1回走査するのにか
かる時間が、カウンタ21に設定された一定時間であ
る。前回走査した時から、一定時間後に走査した時、未
開放アドレス表示ビットに1が書かれている、アドレス
6と8は、メモリリーク領域とみなされる。この領域の
アドレスは、空き領域の末尾アドレスで示される内容に
書かれ、新しい末尾アドレスとして更新される。また、
そのメモリリークアドレスには0が書かれることによっ
て、メモリリーク領域は、空き領域として再割当てされ
る。この場合の、リンクリストメモリ5のアドレスマッ
プは、図4(A)と同一である。
Here, the time required to scan all the addresses once is a fixed time set in the counter 21. When scanning is performed after a predetermined time from the previous scanning, addresses 6 and 8 in which 1 is written in the unreleased address display bit are regarded as memory leak areas. The address of this area is written in the content indicated by the end address of the free area, and is updated as a new end address. Also,
By writing 0 to the memory leak address, the memory leak area is reallocated as a free area. In this case, the address map of the link list memory 5 is the same as that of FIG.

【0046】以上、本発明によるメモリ管理装置の好適
実施形態例の構成及び動作を詳述した。しかし、本発明
は斯る実施形態例のみに限定されるべきではなく、本発
明の要旨を逸脱することなく種々の変形変更が可能であ
ること当業者には容易に理解できよう。
The configuration and operation of the preferred embodiment of the memory management device according to the present invention have been described above in detail. However, the present invention should not be limited to only such an embodiment, and it can be easily understood by those skilled in the art that various modifications can be made without departing from the gist of the present invention.

【0047】[0047]

【発明の効果】上述の説明から理解される如く、本発明
のメモリ管理装置によると、動的に利用されるメモリ
を、使用されている領域と、空き領域との2つの連鎖情
報(リンクリスト)により管理している。無効な領域は
リンクリストを格納するリンクリストメモリのデータの
1ビットに割当てられている。未開放アドレスビット
を、装置の処理能力から決定される一定時間毎に走査す
ることにより検出している。この為に、リンクリストメ
モリのデータ1ビットと、一定時間をカウントするカウ
ンタとリンクリストメモリの未開放アドレスビットを確
認する為の構成を追加するのみで、メモリリークを検出
/回避可能である。従って、簡単な構成で意図するメモ
リリークの検出/回避ができるという実用上の顕著な効
果を有する。
As can be understood from the above description, according to the memory management device of the present invention, a dynamically used memory is divided into two pieces of chain information (a link list) of a used area and a free area. ). The invalid area is assigned to one bit of data in the link list memory for storing the link list. Unopened address bits are detected by scanning at fixed time intervals determined from the processing capacity of the device. For this reason, a memory leak can be detected / avoided only by adding a configuration for confirming one bit of data in the link list memory, a counter for counting a fixed time, and an unreleased address bit of the link list memory. Therefore, there is a practically remarkable effect that the intended memory leak can be detected / avoided with a simple configuration.

【0048】即ち、本発明のメモリ管理装置によると、
動的に割当てられるメモリも、長い時間でみれば、全領
域において必ず書込み/読出しが繰返されており、装置
特有のデータ処理時間をカウントし、一度も空き領域に
割当てられない領域により、メモリリーク領域を検出し
ている。従って、特別な複数の情報や制御用ハードウェ
アが不要であるという効果がある。
That is, according to the memory management device of the present invention,
In the case of a dynamically allocated memory, writing / reading is always repeated in all areas over a long period of time, and the data processing time peculiar to the device is counted. The area has been detected. Therefore, there is an effect that special plural pieces of information and control hardware are not required.

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

【図1】本発明によるメモリ管理装置を使用するバケッ
ト通信システムの構成図である。
FIG. 1 is a configuration diagram of a bucket communication system using a memory management device according to the present invention.

【図2】図1に示すメモリ管理装置の好適実施形態例の
ブロック図である。
FIG. 2 is a block diagram of a preferred embodiment of the memory management device shown in FIG. 1;

【図3】図2に示すメモリ管理装置のアドレス制御部の
詳細ブロック図である。
FIG. 3 is a detailed block diagram of an address control unit of the memory management device shown in FIG.

【図4】図2に示すメモリ管理装置のリンクリストメモ
リのアドレスマップ(A)及びデータメモリのアドレス
マップ(B)の例を示す図である。
4 is a diagram showing an example of an address map (A) of a link list memory and an address map (B) of a data memory of the memory management device shown in FIG. 2;

【図5】図2に示すメモリ管理装置のデータメモリにパ
ケット1及び2が書込まれた後のリンクリストメモリの
アドレスマップを示す図である。
5 is a diagram showing an address map of a link list memory after packets 1 and 2 have been written to a data memory of the memory management device shown in FIG. 2;

【図6】図5に示すパケット1及び2が書込まれている
状態のリンクリストメモリのアドレスマップ例を示す図
である。
6 is a diagram showing an example of an address map of a link list memory in a state where packets 1 and 2 shown in FIG. 5 are written.

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

1 メモリ管理装置 3 データメモリ 4 アドレス制御部 5 リンクリストメモリ 11 先頭アドレス管理部 12 末尾アドレス管理部 21 カウンタ 22 未開放アドレスビット処理部 31 ページ数管理部 32 リンクリストメモリアドレス制御部 33 リンクリストメモリデータ処理部 41 空き領域管理部 42 使用領域管理部 43 アドレス/リンクリスト制御部 DESCRIPTION OF SYMBOLS 1 Memory management device 3 Data memory 4 Address control unit 5 Link list memory 11 Start address management unit 12 End address management unit 21 Counter 22 Unreleased address bit processing unit 31 Page number management unit 32 Link list memory address control unit 33 Link list memory Data processing unit 41 Free area management unit 42 Used area management unit 43 Address / link list control unit

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】入力データを書込要求信号に基づき格納
し、読出要求信号に基づき出力データとして読出すデー
タメモリと、前記入力データの各パケットのリンクリス
トと前記データメモリ空き領域のリンクリストを格納す
るリンクリストメモリと、前記データメモリ及び前記リ
ンクリストメモリ間に接続され、前記データメモリへの
アドレスを生成するアドレス制御部と、を備えることを
特徴とするメモリ管理装置。
1. A data memory for storing input data based on a write request signal and reading it out as output data based on a read request signal, a link list of each packet of the input data, and a link list of the free area of the data memory. A memory management device, comprising: a link list memory for storing; and an address control unit connected between the data memory and the link list memory for generating an address to the data memory.
【請求項2】前記アドレス制御部は、書込アドレス情報
を出力する空き領域管理部、使用領域管理部及び前記空
き領域及び使用領域管理部に接続されるアドレス/リン
クリスト制御部を有することを特徴とする請求項1に記
載のメモリ管理装置。
2. The method according to claim 1, wherein the address control unit includes a free area management unit for outputting write address information, a use area management unit, and an address / link list control unit connected to the free area and use area management unit. The memory management device according to claim 1, wherein:
【請求項3】前記空き領域管理部は、前記データメモリ
の空き領域先頭アドレスを保持する先頭アドレス管理部
及び前記空き領域末尾アドレスを保持する末尾アドレス
管理部を有することを特徴とする請求項2に記載のメモ
リ管理装置。
3. The free area management section according to claim 2, further comprising: a start address management section for holding a free area start address of the data memory; and a tail address management section for holding the free area end address. 3. The memory management device according to claim 1.
【請求項4】前記使用領域管理部は、設定された一定時
間をカウントするカウンタ及び論理回路により構成され
る未開放アドレスビット処理部を有することを特徴とす
る請求項2又は3に記載のメモリ管理装置。
4. The memory according to claim 2, wherein the used area management unit includes an unaddressed address bit processing unit including a counter for counting a set predetermined time and a logic circuit. Management device.
【請求項5】前記アドレス/リンクリスト制御部は、ダ
ウンカウンタ及び初期値設定回路を含むページ数管理
部、アドレス生成用リンクリストメモリアドレス制御部
及びリンクリストメモリデータ処理部を有することを特
徴とする請求項2、3又は4に記載のメモリ管理装置。
5. The address / link list control unit includes a page number management unit including a down counter and an initial value setting circuit, an address generation link list memory address control unit, and a link list memory data processing unit. The memory management device according to claim 2, 3 or 4, wherein:
JP11000471A 1999-01-05 1999-01-05 Memory managing device Pending JP2000200210A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11000471A JP2000200210A (en) 1999-01-05 1999-01-05 Memory managing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11000471A JP2000200210A (en) 1999-01-05 1999-01-05 Memory managing device

Publications (1)

Publication Number Publication Date
JP2000200210A true JP2000200210A (en) 2000-07-18

Family

ID=11474716

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11000471A Pending JP2000200210A (en) 1999-01-05 1999-01-05 Memory managing device

Country Status (1)

Country Link
JP (1) JP2000200210A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008160705A (en) * 2006-12-26 2008-07-10 Fujitsu Ltd Frame transfer method and apparatus
DE102008000649A1 (en) 2007-03-27 2008-10-02 Denso Corp., Kariya Memory management device and method for this
US9465701B2 (en) 2011-04-20 2016-10-11 Fujitsu Limited Relay device and recovery method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008160705A (en) * 2006-12-26 2008-07-10 Fujitsu Ltd Frame transfer method and apparatus
US8065450B2 (en) 2006-12-26 2011-11-22 Fujitsu Limited Frame transfer method and device
DE102008000649A1 (en) 2007-03-27 2008-10-02 Denso Corp., Kariya Memory management device and method for this
US8176263B2 (en) 2007-03-27 2012-05-08 Denso Corporation Memory management apparatus and method for same
US9465701B2 (en) 2011-04-20 2016-10-11 Fujitsu Limited Relay device and recovery method

Similar Documents

Publication Publication Date Title
US20040093454A1 (en) USB endpoint controller flexible memory management
US7165126B2 (en) Direct memory access device
JPH04314163A (en) Buffer managing system
KR100288177B1 (en) Memory access control circuit
JP4855864B2 (en) Direct memory access controller
JP2000200210A (en) Memory managing device
JP2002542705A (en) Circuit device for parallel / serial conversion
US6615292B1 (en) Data transfer apparatus performing DMA data transfer from non-consecutive addresses
JPH0221619B2 (en)
CN110825658B (en) Flash memory controller and method
JPH0512125A (en) Address conversion system
JP3096382B2 (en) DMA circuit
KR100615694B1 (en) Control system for controlling plural function block
JPH0833869B2 (en) Data processing device
JPH0731523B2 (en) Programmable controller device
JPH0711796B2 (en) Channel processor
JP4002474B2 (en) Line buffer controller
JP2969776B2 (en) Data identification method
JPS63228855A (en) Communication controller
JP2710219B2 (en) DMA controller
JPS63237143A (en) Programmable controller
JP2000181788A (en) File managing method for file system
JPH05324534A (en) Dma transfer system
JPH0563808A (en) Traffic collection control system
JPS622344A (en) Information transmission equipment