System and Method for Auditing Memory
Abstract
According to one embodiment of the invention, a method of auditing memory in a system comprises receiving a request for memory from an application and populating a memory tag with a stack depth component and a traceback stack component. The traceback stack component contains a pointer to a traceback stack. The stack depth component defines a size of the traceback stack. The traceback stack contains information from a program stack associated with the application. The embodiment may further comprise determining if a memory pool has enough free memory to satisfy the request and allocating, from the memory pool, a memory allocation unit if the memory pool has enough free memory to satisfy the request. The memory allocation unit may include a data area and a footer. The data area defines an area to which the application may write data and the footer bounds the data area with a special code.
Claims
exact text as granted — not AI-modified1 . A method of auditing memory in a system, the method comprising:
receiving a memory request from an application; populating a memory tag having a stack depth component and a traceback stack component, the traceback stack component containing a pointer to a traceback stack, the stack depth component defining a size of the traceback stack, and the traceback stack containing information from a program stack associated with the applications determining if a memory pool has enough free memory to satisfy the request for memory; and allocating, from a memory pool, a memory allocation unit with a data area and a footer, the data area defining an area to which the application may write data, and the footer bounding the data area with a special code.
2 . The method of claim 1 , wherein the memory request is a request for memory and
wherein the allocating, from a memory pool, a memory allocation unit with a data area and a footer further comprises allocating, from the memory pool, the memory allocation unit if the memory pool has enough free memory to satisfy the request for memory.
3 . The method of claim 2 , further comprising:
receiving a request to return the memory allocation unit; determining whether the header of the memory allocation unit is valid; determining whether the special code in the footer of the memory allocation unit has changed; and returning the memory allocation unit back to the memory pool if the memory allocation unit header is valid and the special code in the footer has not changed.
4 . The method of claim 2 , wherein the memory tag includes an activity type component defining a type of activity involved in populating the memory tag, further comprising:
receiving a request to return the memory allocation unit; determining whether the header of the memory allocation unit is valid; and populating the activity type component with a deallocation failure flag upon determining that the memory allocation unit header is invalid.
5 . The method of claim 2 , wherein the memory tag includes an activity type component defining a type of activity involved in populating the memory tag, further comprising:
receiving a request to return the memory allocation unit; determining whether the header of the memory allocation unit is valid; determining whether the special code in the footer of the memory allocation unit has changed; and populating the activity type component with an overrun flag upon determining that the memory allocation unit header is valid and the special code in the footer has changed.
6 . The method of claim 1 , further comprising:
storing the memory tag in a memory tag list.
7 . The method of claim 6 , further comprising:
receiving a request to return the memory allocation unit; determining whether the header of the memory allocation unit is valid; determining whether the special code in the footer of the memory allocation unit has changed; returning the memory allocation unit back to the memory pool if the memory allocation unit header is valid and the special code in the footer has not changed; and removing the memory tag from the memory tag list after returning the memory allocation unit back to the memory pool.
8 . (canceled)
9 . The method of claim 1 , wherein the memory tag includes an activity type component defining a type of activity involved in populating the memory tag.
10 . The method of claim 9 , wherein the memory request is a request for memory, further comprising:
populating the activity type component with an allocation error flag if the memory pool does not have enough memory to satisfy the request for memory.
11 . The method of claim 9 ], wherein the memory request is a request to return a memory allocation unit from an application, further comprising:
determining whether the header of the memory allocation unit is valid; determining whether the special code in the footer of the memory allocation unit has changed; and populating the activity type component with an overrun flag upon determining that the memory allocation unit header is valid and the special code in the footer has changed.
12 . The method of claim 1 , wherein the memory request is a request for memory, further comprising:
reading the program stack associated with the application; and populating the traceback stack with information from the program stack.
13 . The method of claim 11 , further comprising:
storing both the traceback stack and the memory tag in a memory tag list.
14 . A method of auditing memory in a system, the method comprising:
receiving a request for memory from an application; and allocating, from a memory pool, a memory allocation unit with a data area and a footer, the data area defining an area to which the application may write data, and the footer bounding the data area with a special code; and populating a memory tag having a stack depth component and a traceback stack component, the traceback stack component containing a pointer to a traceback stack, the stack depth component defining a size of the traceback stack, and the traceback stack containing information from a program stack associated with the application.
15 . The method of claim 14 , further comprising:
receiving a request to return the memory allocation unit; determining whether the header of the memory allocation unit is valid; determining whether the special code in the footer of the memory allocation unit has changed; and returning the memory allocation unit back to the memory pool if the memory allocation unit header is valid and the special code in the footer has not changed.
16 . The method of claim 15 , wherein the memory allocation unit further includes a header, further comprising:
validating the header prior to determining whether the footer of the memory allocation unit has changed.
17 . The method of claim 14 , the memory tag further comprising:
an activity type component, and a task identification component, the activity type component defining a type of activity involved in populating the memory tag, and the task identification component identifying a task in the application associated with the request for memory.
18 . A memory tag for auditing memory comprising:
a traceback stack component containing a pointer to a traceback stack, the traceback stack containing information from a program stack; a stack depth component, the stack depth component defining a size of the traceback stack, and an activity type component, the activity type component defining a type of activity involved in populating the memory tag, the activity type component storing an allocation flag upon successful allocation of memory.
19 . The memory tag of claim 18 , further comprising:
a previous memory tag component, the previous memory tag component pointing towards a previous memory tag stored on a memory tag list; and a next memory tag component, the next memory tag component pointing towards a next memory tag stored on a memory list.
20 . The memory tag of claim 18 , wherein the memory tag is associated with an application, further comprising:
a task identification component identifying a task in the application associated with populating the memory tag.
21 . The memory tag of claim 18 , wherein the activity type component further stores one of the following: an allocation error flag, an overrun flag, and a deallocation failure flag.Join the waitlist — get patent alerts
Track US2009240909A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.