1. A computer-implemented method for memory management, comprising: determining a target amount of heap space to be deallocated for a program by garbage collection during runtime; estimating an amount of heap space reachable by each of a plurality of soft references in the program by determining for each of the plurality of soft references a cumulative size of no more than N objects reachable from the respective soft reference, wherein N is an integer greater than zero; and deallocating heap space based on at least the target amount of heap space to deallocate and the amount of heap space reachable by the plurality of soft references.