A system and method for iterative code optimization using adaptive or
dynamic size metrics, for use with run-time software systems and virtual
machines. The dynamic size metric may be calculated both for a set of
predetermined factors (together with associated weights), and also for a
set of variable factors determined during the runtime code introspection
process. The predetermined factors, and their associated weights, may be
varied to reflect the overall performance of the code in each
optimization instance.