title: How does a HashMap occupy memory?
body: <p>I fear downvotes. Anyways, just like an ArrayList would have a contiguous memory allocation, a LinkedList would have a random memory allocation, how does HashMap occupy memory? Does it also take random chunks in the memory? Can I be briefed with a memory diagram of how map's buckets and the LinkedLists inside are located in the memory?</p>
  
  <p>I hope this is not a bs question. Did not find much of information regarding Map's memory allocation diagram.</p>
  
  <p><strong>EDIT</strong>: The question I put has nothing to do with debugging/profiling. It's just about how a HashMap fits into the memory. I was unclear about it.</p>