Java tutorial
//package com.java2s; import java.lang.ref.SoftReference; import java.util.LinkedHashMap; public class Main { private static LinkedHashMap<String, SoftReference<String>> RequestCache = new LinkedHashMap<String, SoftReference<String>>( 20); private static void putStringForSoftReference(String requestUrl, String result) { // TODO Auto-generated method stub SoftReference<String> referece = new SoftReference<String>(result); RequestCache.put(requestUrl, referece); } }