不要使用字符串字面值与WeakHashMap一起使用(虽然可以,但没有意义): String myKey = "somekey"; 相反,你必须使用: String myKey = new String("somekey"); 在后一种情况下,字符串不会被池化。