I would genuinely interested to see how much bytes a HashMap<Integer, Integer> would have in Java (or other languages) for a million entries. If I am not mistaken in julia, this would be 151 MB in julia or 88% more than just storing the keys and values.
julia> k = Int32.(1:1000_0000); v = rand(Int32,1000_0000);
julia> dict = Dict(zip(k,v));
julia> Base.summarysize(dict) / (2 * 4 * 1000_0000)
1.8874391
julia> Base.summarysize(dict)
150995128