Patent ID: 8239861

Claim:
A method of performing a processing task in a data processing apparatus that reduces memory usage of said processing task, said processing task being performed using a virtual machine associated with said data processing apparatus, said processing task comprising at least one processing function, said method comprising said virtual machine performing the steps of: (a) accessing platform-neutral program code corresponding to a representation of said at least one processing function in a function repository associated with said virtual machine; (b) executing said processing task on said virtual machine using said platform-neutral program code; (c) analysing, at a current execution point, said at least one processing function on a function-by-function basis to identify an inactive function; (d) performing software-based unloading, from said function repository, of at least a portion of platform-neutral program code corresponding to said inactive function, wherein said virtual machine is configured to determine, when performing said software-based unloading, whether all functions of a class to which said inactive function corresponds have been unloaded, and, when said virtual machine determines that all of said functions of said class have been unloaded, said virtual machine initiates software-based unloading of class information corresponding to said unloaded functions; and (e) providing a software-based reloading mechanism for reloading of said unloaded portion of platform-neutral program code for execution of said inactive function by said virtual machine, wherein said software-based reloading mechanism is configured to check whether said class information corresponding to said unloaded functions associated with said class is present in said function repository and to initiate reloading of said class information if said class information is determined not to be present in said function repository prior to execution of a corresponding unloaded function.