Software evolves during its life time; modification includes bug fixes, adding features, and refactoring. Traditional updating methods require software to shutdown, apply update to data and application, and reboot. However, lot software need 7*24 services and cannot apply this update. Dynamic software updating (DSU) is devel-oped to address this problem. With DSU, software can be updated while executing.DSU is proved to be useful for C language applications, and several DSU frameworks can support DSU for C with various changes. Java, as another popular programming language, still doesn't have many efficient DSU frameworks. To im-plement an efficient DSU framework for Java is meaningful.This thesis first analyzes the evolution of Java applications, to examine if Java applications are fit for applying DSU. Using AST matching, it is found that early ver-sions of an application may change dramatically. However, changes will become smooth quickly with evolution. With this discovery, we believe DSU for Java applica-tion is practical.We surveyed several DSU framework for C and invent a new update algorithm we called "update by thread" which is much simpler to understand and implement than traditional update algorithms like "update at safe point" or "update by function" which are used in existing C DSU frameworks. This algorithm makes a thread only consider the status of itself, invoke methods according to thread's version. And when the thread run to a status that is common between old and new version, it switches from old version to new version. This algorithm eliminates the communication be-tween threads that is needed to decide if the application is at a safe point or a function is not used by any thread. So, the algorithm is better for multi-threads applications.We implemented caprice using two techniques:with modification to Harmony JVM or use JVMTI only. It is easy to implement caprice with modification to JVM. However, it makes caprice more portable and extensible using JVMTI. The thesis presents the implementations and problems of both frameworks. We tested the JVMTI version framework using real world application and present the experiences. |