Skip to content

Instantly share code, notes, and snippets.

@jerolba
Last active March 19, 2019 19:47
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 jerolba/94ceefda3bde0897ed987e708e4cbcd5 to your computer and use it in GitHub Desktop.
Save jerolba/94ceefda3bde0897ed987e708e4cbcd5 to your computer and use it in GitHub Desktop.
MemoryHistogram diff = Histogramer.getDiff(() -> {
HashMap<Integer, String> map = new HashMap<>();
for (int i = 0; i < 10000; i++) {
map.put(i, "" + i);
}
return map;
});
HistogramEntry nodes = diff.get("java.util.HashMap$Node");
System.out.println(nodes.getInstances());
System.out.println(nodes.getSize());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment