Patent ID: 7689558

Claim:
A method comprising: installing a plurality of profile agents in a computer application with a profiler, the computer application being stored in a computer memory and including a plurality of program objects, each of the profile agents being set in an initialization method for one of the plurality of program objects, the profile agents being inserted during compilation of byte code for the computer application, wherein each profile agent generates an event when there is an entry into the respective initialization method or an exit from the initialization method; subsequent to inserting the profile agents during compilation of the byte code for the computer application, receiving a notification from a server regarding excessive memory usage by the computer application; switching on one or more of the profile agents with the profiler in response to the notification, wherein the one or more profile agents are switched on by the profiler without recompiling the computer application; running the computer application including the one or more profile agents using one or more processors; monitoring for events generated by the one or more profile agents during the running of the computer application; identifying one or more program objects causing the excessive memory usage based on the events generated by the one or more profile agents; and switching the one or more profile agents off, wherein the one or more profile agents are switched off without recompiling the computer application or removing the one or more profile agents from the computer application.