Memory overhead of Java HashMap compared to ArrayList

后端 未结 13 1845
不知归路
不知归路 2020-11-30 02:15

I am wondering what is the memory overhead of java HashMap compared to ArrayList?

Update:

I would like to improve the speed for searching fo

13条回答
  •  迷失自我
    2020-11-30 02:28

    The simplest thing would be to look at the source and work it out that way. However, you're really comparing apples and oranges - lists and maps are conceptually quite distinct. It's rare that you would choose between them on the basis of memory usage.

    What's the background behind this question?

提交回复
热议问题