Skip to content

Instantly share code, notes, and snippets.

@sdhjl2000
Created January 5, 2018 14:04
Show Gist options
  • Save sdhjl2000/363f9d90a3e5e54f454bafde66be1794 to your computer and use it in GitHub Desktop.
Save sdhjl2000/363f9d90a3e5e54f454bafde66be1794 to your computer and use it in GitHub Desktop.
java gc
Cache<Integer,byte[]> cache= CacheBuilder.newBuilder().maximumSize(1000).build();
for (int i = 0; i < Integer.MAX_VALUE; i++) {
byte[] by=new byte[100000];
cache.put(i,by);
Thread.sleep(10);
}
int str= System.in.read();
System.out.print(str);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment