UNLOADING JAVA CLASSES THAT CONTAIN STATIC FIELDS

Citation
Ce. Mcdowell et Ea. Baldwin, UNLOADING JAVA CLASSES THAT CONTAIN STATIC FIELDS, ACM SIGPLAN NOTICES, 33(1), 1998, pp. 56-60
Citations number
3
Categorie Soggetti
Computer Science Software Graphycs Programming","Computer Science Software Graphycs Programming
Journal title
Volume
33
Issue
1
Year of publication
1998
Pages
56 - 60
Database
ISI
SICI code
Abstract
In Java, the definition of a ''program'' is a bit fuzzy. A Java applet is essentially a Java application (i.e. program) that can be executed by a Java enabled Web browser (i.e. an OS). An applet running inside of a browser was intended to be analogous to a conventional applicatio n running under on OS, hence the netcentric ''browser is your OS'' mod el. However, as currently implemented, this analogy breaks down with r egard to the system resources allocated for classes and in particular for static fields in classes (i.e. class variables) when the class was loaded as part of an applet. Without class unloading, a long running Java application such as a browser is like an OS that does not release memory resources allocated for application code space when the applic ation terminates. With class unloading, as currently implemented, the semantics of static fields in classes are broken. In this paper we det ail the problem and provide a solution. The solution combines restrict ing when classes can be unloaded, with a greater use of non-default cl ass loaders.