Method and system for global constant management. A method of operating a
computer is described in which, for data structures and a set of data
structures, the date structure is received from a first memory. The data
structure includes one or more sets of instructions and a set of one or
more constants. The data structure is stored in a second memory. If
constants from the data structure have not been stored in other data
structures in the second memory, other than the first data structure,
then constants in the data structures are stored in data structures in
second memory. The constants from the first data structure in the second
memory are replaced with links to respective other data structures in the
second memory. In one example system, the data structure from the first
memory comprises a Java class, and the sets of instructions comprise Java
methods. The constants from the data structure in the first memory may
comprise a constant pool.