Skip to content

Instantly share code, notes, and snippets.

@adrianoalmeida7
Created March 21, 2011 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrianoalmeida7/880240 to your computer and use it in GitHub Desktop.
Save adrianoalmeida7/880240 to your computer and use it in GitHub Desktop.
java.lang.ref tests
public static void main(String[] args) {
WeakReference<Object> ref = new WeakReference<Object>(new Object());
Map<Integer, Integer> mapa = new HashMap<Integer, Integer>();
for(int i = 0; i < 10000000; i++) {
System.out.println(i + "--" + ref.get());
mapa.put(i, i);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment