Measuring maximum memory requirement of an application at any point through continuous use of garbage collector
AssigneeSun Microsystems, Inc.
InventorMoshe Sayag
Life of this patent
Estimating the term…
Abstract
Method and apparatus are disclosed for the intensive use of garbage collection in order to determine the maximum amount of memory that is consumed by a running application. A system garbage collector executes between designated pairs of program instructions or statements. The amount of memory used by the application is known after each designated program instruction or statement, and is equal to its theoretical requirement. A developer is able to determine whether a specified memory allotment for an application is ever exceeded.
Claims23
A method for evaluating maximum memory requirements of a computer application on a development platform, comprising the steps of:
- executing a sequence of program instructions in said application;
- running a garbage collector following execution of at least designated ones of said program instructions to free a portion of a heap memory that is no longer in use;
- after running said garbage collector, determining a current size of said heap memory;
- comparing said current size of said heap memory with a previous maximum size of said heap memory;
- and
- responsive to said step of comparing, memorizing a current maximum size of said heap memory.
A computer software product, comprising a computer-readable medium in which computer program instructions are stored, which instructions, when read by a computer, cause the computer to perform a method comprising the steps of:
- executing a sequence of said program instructions of an application;
- running a garbage collector following execution of at least designated ones of said program instructions to free a portion of a heap memory that can no longer be used;
- after running said garbage collector, determining a current size of said heap memory;
- comparing said current size of said heap memory with a previous maximum size of said heap memory;
- and
- responsive to said step of comparing, memorizing a current maximum size of said heap memory.
A development system for evaluating memory requirements of a computer application, comprising:
- a user interface adapted for executing code of said application, said user interface being further adapted for identification of a range of successive locations in said code at which garbage collection is to be performed;
- a memory, comprising a location holding a stored maximal value of a heap, and containing a data structure, said data structure including computer instructions that are invokable via said user interface for allocation of said heap, comprising:
- a first instruction to invoke a garbage collector for said heap when instructions of said range are being executed;
- a second instruction to return a current size of said heap that is still being used by said application;
- a third instruction for storing a larger value of said stored maximal value and said current size in said location.
Dependencies are inferred from the claim text.