1. A method of optimizing an application to reduce local memory usage, the method comprising: instrumenting at least one executable class file of the application with analysis code, the executable class file comprising bytecode; executing the class file on a virtual machine, wherein during execution the analysis code generates data related to the application's use of local memory; via a processor, analyzing the data related to the application's use of the local memory to generate a memory profile analysis, wherein analyzing the data related to the application's use of the local memory to generate the memory profile analysis comprises identifying at least one object or string that is loaded into the local memory when the object or string is not yet required by the application; and based on the memory profile analysis, automatically revising at least one portion of the bytecode to reduce an amount of the local memory used by the application, wherein automatically revising at least one portion of the bytecode to reduce the amount of the local memory used by the application comprises revising the bytecode to prevent the object or string from being loaded into the local memory until the object or string is required by the application.