JVM Languages
jqa1001.txt
Associated article: Can J2EE Manage Cache and Pool Memory?
Tags: JVM Languages
Published source code accompanying the article by Art Jolin in which he examines how you can J2EE manage cache and pool memory. Also see JQA1001.ZIP.
Java Q&A
by Art Jolin
Example 1:
(a)
public class Bar {
...
private Foo myFoo = new Foo();
...
}
(b)
public class Bar {
...
private SoftReference myFooRef = new SoftReference(new Foo());
...
}
Example 2:
public void someMethod() {
Foo myFoo = myFooRef.get();
If (myFoo == null)
.....recreate ...


