The present invention provides a system and method for improving the effectiveness
of a data processing application when using a virtual machine, where the program
includes many methods, i.e. program sections, that are stored in the memory of
the computer used, and where garbage collecting is used by said program. Thread
stacks are first analyzed with respect to methods required thereby. Each of the
methods required is caused to be regenerated where occurrent references to a method
are replaced with reference to regenerated methods prior to the regeneration of
a method. All non-regenerated methods are then erased, wherein the corresponding
memory space is placed at the disposal of said program. Various means of locking
and garbage collection can be used.