1. A method for optimizing use of heap memory, comprising: with a processor, extending a cache implementation with a base class; with said processor, attaching an instance of a utility class to said base class; registering said cache implementation to a garbage collector routine with said processor; storing said registration as a reference list in a memory; responsive to an unsatisfied cache allocation request, triggering a garbage collection cycle to check heap occupancy; responsive to exceeding a first threshold value, traversing said reference list to identify caches for cleanup based upon a defined space constraint value, wherein said space constraint value comprises a plurality of defined percentages of total caches to be cleaned; and clearing all said identified caches in compliance with a plurality of criteria and in accordance with said defined space constraint value.