Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 331 Bytes

README.md

File metadata and controls

23 lines (19 loc) · 331 Bytes

MapSize

How much memory is occupied by map.

go get github.com/520MianXiangDuiXiang520/MapSize
package main

import (
	"fmt"
	"github.com/520MianXiangDuiXiang520/MapSize"
)

func main() {
	m := make(map[int]struct{})
	for i := 0; i < 100; i++ {
		m[i] = struct{}{}
	}
	fmt.Println(mapsize.Size(m)) // 1416
}