Annonymous Inner classes in Java and Garbage collection
Eliot Moss <[email protected]> Fri, 22 Dec 2006 10:01:46 -0500
| Newsgroups | gmane.comp.programming.garbage-collection.general |
|---|---|
| Message-ID | <[email protected]> |
Unmesh -- What memory do you think is being "leaked", i.e., not reclaimed? Are you concerned about failure to reclaim a _class_ or an _instance_ (and of what class)? I don't see that anonymous inner classes pose any particular new problem. Note that while, in _concept_, you get a new anonymous class for each enclosing _instance_, in practice the class exists just once, with no statics (by design of the language feature), and an instance refers to an instance of the outer class. Does this help answer the question? -- Eliot Moss ============================================================================== J. Eliot B. Moss, Associate Professor http://www.cs.umass.edu/~moss www Director, Arch. and Lang. Impl. Lab. +1-413-545-4206 voice Department of Computer Science +1-413-695-4226 cell 140 Governor's Drive, Room 372 +1-413-545-1249 fax University of Massachusetts at Amherst [email protected] email Amherst, MA 01003-9264 USA +1-413-545-3733 Priscilla Coe sec'y ==============================================================================