Memory allocation analysis
AssigneeMicrosoft Corporation
InventorCalvin Hsia
Life of this patent
Estimating the term…
Abstract
The subject disclosure relates to analyzing memory allocations for one or more computer-implemented processes. In particular, in conjunction with employing tags for tracking memory allocation commands, currently allocated memory can be examined for various characteristics of inefficient memory use. For example, as memory is initially allocated, a predetermined bit pattern can be written to the newly allocated memory. Thus, detection of the predetermined bit pattern can be indicative of wasted memory use. Moreover, additional features can be provided to both analyze data and present views associated with that analysis relating to identification of memory fragmentation, over-allocation, sparse memory use, duplication of allocations, multiple module loads, and so forth.
Claims20
A method performed by a computing system having a processor and memory, the method comprising:
- detecting a memory allocation instruction to allocate a portion of the memory, the memory allocation instruction being issued by a process executed by the processor;
- in response to the detected memory allocation instruction for allocating a portion of the memory,
- allocating a portion of the memory;
- creating a tag corresponding to the allocated portion of the memory, the tag including information of a call stack associated with the monitored memory allocation instruction;
- and
- storing the created tag in a private heap of the memory;
- subsequently, detecting a memory release instruction to release the allocated portion of the memory;
- and
- in response to the detected memory release instruction, deleting the stored tag corresponding to the allocated portion of the memory from the private heap of the memory.
A computing system, comprising:
- a processor and a memory coupled to the processor, the memory containing instruction that when executed by the processor cause the processor to perform a process that includes:
- monitoring for memory allocation instructions and memory release instructions from one or more processes executed by the processor, the one or more processes including a garbage collection process;
- upon detection of a memory allocation instruction for allocating a portion of the memory,
- creating a tag corresponding to an allocated portion of the memory in response to the memory allocation instruction, the tag including information of a call stack associated with the monitored memory allocation instruction;
- and
- storing the created tag in a private heap of the memory;
- and
- upon detection of a monitored release instruction to release the allocated portion of the memory, deleting the tag from the private heap of the memory.
A method performed by a computing system having a processor and memory, the method comprising:
- monitoring for memory allocation instructions and memory release instructions from one or more processes executed by the processor, the one or more processes including a garbage collection process;
- upon detection of monitored memory allocation instructions individually for allocating a portion of the memory,
- allocating portions of the memory corresponding to the individual memory allocation instructions;
- creating tags corresponding to the individual allocated portions of the memory, the tags each including information associated with a call stack corresponding to the individual memory allocation instructions;
- and
- storing the created tags in a private heap of the memory;
- upon detection of a monitored release instruction to release one of the allocated portions of the memory, deleting a tag from the private heap of the memory, the deleted tag corresponding to the allocated portion of the memory;
- and
- detecting at least one of duplication in memory allocation or fragmentation based on the information of the call stack associated with each of the tags currently stored in the private heap.
Dependencies are inferred from the claim text.