Methods, systems, and articles of manufacture consistent with the present
invention optimize allocation of items to a stack memory instead of a
heap memory. It is determined whether an item to be placed on the heap
memory escapes from the scope of the item's allocator, and whether the
item survives the item's allocator. The item is allocated to the stack
memory responsive to the item not escaping from the scope of the item's
allocator and not surviving the item's allocator.