Method for tracking memory allocation in network file server
First Claim
1. A method for tracking server memory allocations and deallocations that are attempted or invoked by system calls made from one or more server resident programs running in a computer network server, where the server is operating under control of a network operating system having system memory allocation functions callable by the one or more server resident programs for making desired memory allocations and deallocation, the method comprising the steps of:
- (a) allocating memory blocks for storing tracking information wherein said step (a) of allocating memory blocks includes;
(a.1) allocating a first pool of memory blocks for storing normal return information; and
(a.2) allocating a second pool of memory blocks for storing exception messages;
(b) identifying entry points for accessing the system memory allocation functions;
(c) replacing initial instructions of the system memory allocation functions that are accessed by the identified entry points with jump instructions so as to cause system calls made to those system functions to be redirected to respective tracker routines;
(d) in response to each system call whose execution is redirected to a respective tracker routine, executing instructions equivalent to the respectively replaced initial instructions of the called system memory allocation function, and then calling the remainder of the called system memory allocation function from the tracker routine to which the redirection jump was made;
(e) receiving return information from the called remainder of the system memory allocation function at the corresponding tracker routine;
(f) recording the received return information in the memory blocks allocated for storing tracking information, and(g) returning the received return information to the server resident program that made the system call.
14 Assignments
0 Petitions
Accused Products
Abstract
A method for dynamically tracking memory resource allocations/deallocations of a program resident in the memory of a network file server is disclosed wherein calls to system memory allocation functions are intercepted and diverted to memory resident tracker routines, interposed between the caller and the called functions to monitor returns from the called functions. Public symbol lists of application program interfaces are scanned for functions to be tracked, and function entry points are taken over by replacing initial instructions of the system functions with jumps to the tracker routines. The tracker routines then call the remainder of the system functions and record the reply before passing control back to the original caller program. Information on allocated blocks is written to ABLK blocks taken from an ABLK free block pool allocated at tracker startup. Subsequent deallocations of the allocated blocks release the same ABLK blocks back to the ABLK free pool. Information on "NULL" pointer and similar returns indicating allocation/deallocation errors is written to MSG queue blocks taken from a MSG free block pool allocated at tracker startup. Log file generator threads are activated to list the filled ABLK and MSG blocks when signalled. Cleanup routines restore the replaced code and deallocate all ABLK and MSG memory blocks when the tracker exits.
-
Citations
10 Claims
-
1. A method for tracking server memory allocations and deallocations that are attempted or invoked by system calls made from one or more server resident programs running in a computer network server, where the server is operating under control of a network operating system having system memory allocation functions callable by the one or more server resident programs for making desired memory allocations and deallocation, the method comprising the steps of:
-
(a) allocating memory blocks for storing tracking information wherein said step (a) of allocating memory blocks includes; (a.1) allocating a first pool of memory blocks for storing normal return information; and (a.2) allocating a second pool of memory blocks for storing exception messages; (b) identifying entry points for accessing the system memory allocation functions; (c) replacing initial instructions of the system memory allocation functions that are accessed by the identified entry points with jump instructions so as to cause system calls made to those system functions to be redirected to respective tracker routines; (d) in response to each system call whose execution is redirected to a respective tracker routine, executing instructions equivalent to the respectively replaced initial instructions of the called system memory allocation function, and then calling the remainder of the called system memory allocation function from the tracker routine to which the redirection jump was made; (e) receiving return information from the called remainder of the system memory allocation function at the corresponding tracker routine; (f) recording the received return information in the memory blocks allocated for storing tracking information, and (g) returning the received return information to the server resident program that made the system call. - View Dependent Claims (2)
-
-
3. A method for tracking server memory allocations and deallocations that are attempted or invoked by system calls made from one or more server resident programs running in a computer network server, where the server is operating under control of a network operating system having system memory allocation functions callable by the one or more server resident programs for making desired memory allocations and deallocations and wherein said network operating system has both externally and internally listed groups of public functions that are callable by a server resident program, the method comprising the steps of:
-
(a) allocating memory blocks for storing tracking information; (b) identifying entry points for accessing the system memory allocation functions and wherein the step (b) of identifying entry points includes; (b.1) searching the externally listed public functions for callable memory allocation functions; (b.2) searching the internally listed public functions for callable memory allocation functions; and (b.3) identifying the entry points of found memory allocation functions in both the externally and internally listed groups of public functions; (c) replacing initial instructions of the system memory allocation functions that are accessed by the identified entry points with jump instructions so as to cause system calls made to those system functions to be redirected to respective tracker routines; (d) in response to each system call whose execution is redirected to a respective tracker routine, executing instructions equivalent to the respectively replaced initial instructions of the called system memory allocation function, and then calling the remainder of the called system memory allocation function from the tracker routine to which the redirection jump was made; (e) receiving return information from the called remainder of the system memory allocation function at the corresponding tracker routine; (f) recording the received return information in the memory blocks allocated for storing tracking information, and (g) returning the received return information to the server resident program that made the system call. - View Dependent Claims (4, 5)
-
-
6. A method for tracking server memory allocations and deallocations that are attempted or invoked by system calls made from one or more server resident programs running in a computer network server, where the server is operating under control of a network operating system having system memory allocation functions callable by the one or more server resident programs for making desired memory allocations and deallocations, the method comprising the steps of:
-
(a) allocating memory blocks for storing tracking information; (b) identifying entry points for accessing the system memory allocation functions; (c) replacing initial instructions of the system memory allocation functions that are accessed by the identified entry points with jump instructions so as to cause system calls made to those system functions to be redirected to respective tracker routines; (d) in response to each system call whose execution is redirected to a respective tracker routine, executing instructions equivalent to the respectively replaced initial instructions of the called system memory allocation function, and then calling the remainder of the called system memory allocation function from the tracker routine to which the redirection jump was made; (e) receiving return information from the called remainder of the system memory allocation function at the corresponding tracker routine; (f) recording the received return information in the memory blocks allocated for storing tracking information and wherein said step (f) of recording is limited to memory allocations and deallocations that are attempted or invoked by system calls made from an identified one of plural server resident programs running in the computer network server; and (g) returning the received return information to the server resident program that made the system call. - View Dependent Claims (7)
-
-
8. A method for tracking server memory allocations and deallocations that are attempted or invoked by system calls made from one or more server resident programs running in a computer network server, where the server is operating under control of a network operating system having system memory allocation functions callable by the one or more server resident programs for making desired memory allocations and deallocations, the method comprising the steps of:
-
(a) allocating memory blocks for storing tracking information; (b) identifying entry points for accessing the system memory allocation functions; (c) replacing initial instructions of the system memory allocation functions that are accessed by the identified entry points with jump instructions so as to cause system calls made to those system functions to be redirected to respective tracker routines; (d) in response to each system call whose execution is redirected to a respective tracker routine, executing instructions equivalent to the respectively replaced initial instructions of the called system memory allocation function, and then calling the remainder of the called system memory allocation function from the tracker routine to which the redirection jump was made; (e) receiving return information from the called remainder of the system memory allocation function at the corresponding tracker routine; (f) recording the received return information in the memory blocks allocated for storing tracking information; (g) returning the received return information to the server resident program that made the system call; and (h) using the return information recorded in the allocated memory blocks for identifying improper attempts or invocations of server memory allocations and deallocations by system calls made from one or more server resident programs being tracked wherein the one or more tracked server resident programs allocate system memory after being loaded but do not deallocate the allocated system memory prior to being unloaded.
-
-
9. A method for tracking server memory allocations and deallocations that are attempted or invoked by system calls made from one or more server resident programs running in a computer network server, where the server is operating under control of a network operating system having system memory allocation functions callable by the one or more server resident programs for making desired memory allocations and deallocations, the method comprising the steps of:
-
(a) allocating memory blocks for storing tracking information; (b) identifying entry points for accessing the system memory allocation functions; (c) replacing initial instructions of the system memory allocation functions that are accessed by the identified entry points with jump instructions so as to cause system calls made to those system functions to be redirected to respective tracker routines; (d) in response to each system call whose execution is redirected to a respective tracker routine, executing instructions equivalent to the respectively replaced initial instructions of the called system memory allocation function, and then calling the remainder of the called system memory allocation function from the tracker routine to which the redirection jump was made; (e) receiving return information from the called remainder of the system memory allocation function at the corresponding tracker routine; (f) recording the received return information in the memory blocks allocated for storing tracking information; (g) returning the received return information to the server resident program that made the system call; and (h) using the return information recorded in the allocated memory blocks for identifying improper attempts or invocations of server memory allocations and deallocations by system calls made from one or more server resident programs being tracked wherein the one or more tracked server resident programs attempt to deallocate system memory after being loaded but have not previously allocated system memory prior to attempting the deallocation.
-
-
10. A method for tracking server memory allocations and deallocations that are attempted or invoked by system calls made from one or more server resident programs running in a computer network server, where the server is operating under control of a network operating system having system memory allocation functions callable by the one or more server resident programs for making desired memory allocations and deallocations, the method comprising the steps of:
-
(a) allocating memory blocks for storing tracking information; (b) identifying entry points for accessing the system memory allocation functions; (c) replacing initial instructions of the system memory allocation functions that are accessed by the identified entry points with jump instructions so as to cause system calls made to those system functions to be redirected to respective tracker routines; (d) in response to each system call whose execution is redirected to a respective tracker routine, executing instructions equivalent to the respectively replaced initial instructions of the called system memory allocation function, and then calling the remainder of the called system memory allocation function from the tracker routine to which the redirection jump was made; (e) receiving return information from the called remainder of the system memory allocation function at the corresponding tracker routine; (f) recording the received return information in the memory blocks allocated for storing tracking information; (g) returning the received return information to the server resident program that made the system call; and (h) using the return information recorded in the allocated memory blocks for identifying improper attempts or invocations of server memory allocations and deallocations by system calls made from one or more server resident programs being tracked wherein the one or more tracked server resident programs attempt to deallocate system memory to a first free pool after having allocated the system memory from a different second free pool.
-
Specification