Re: [go-nuts] What is the proper way to delete a key which holding a pointer in a map

2018-08-27 Thread ojucie
Replace your 1 billion entry map with a large number of small maps. When you need to remove an entry you just substitute a small map. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it

Re: [go-nuts] What is the proper way to delete a key which holding a pointer in a map

2018-08-27 Thread Kasun Vithanage
Yeah saw that, but what about a map with around 10 entries. this will add a lot of overhead i guess. On Monday, August 27, 2018 at 3:13:39 PM UTC+5:30, Jan Mercl wrote: > > On Mon, Aug 27, 2018 at 11:38 AM Kasun Vithanage > wrote: > > > I simply want to delete the memory allocated by Val

Re: [go-nuts] What is the proper way to delete a key which holding a pointer in a map

2018-08-27 Thread Jan Mercl
On Mon, Aug 27, 2018 at 11:38 AM Kasun Vithanage wrote: > I simply want to delete the memory allocated by Value too. When i checked memory with MemStats, its still same as when i added entries to map See https://github.com/golang/go/issues/20135#issuecomment-297490415 "The only available workar

Re: [go-nuts] What is the proper way to delete a key which holding a pointer in a map

2018-08-27 Thread Kasun Vithanage
I simply want to delete the memory allocated by Value too. When i checked memory with MemStats, its still same as when i added entries to map On Monday, August 27, 2018 at 3:02:53 PM UTC+5:30, Hau Ma wrote: > > I think there is a major different: the memory allocated for key "index" > in hashmap

Re: [go-nuts] What is the proper way to delete a key which holding a pointer in a map

2018-08-27 Thread Hau Ma
I think there is a major different: the memory allocated for key "index" in hashmap, if you assign m[index] to nil, the allocated memory for hashed key "index" still exist, when delete the allocated memory will be deleted as well. Both will have same affect on the pointer to struct, it will be coll

[go-nuts] What is the proper way to delete a key which holding a pointer in a map

2018-08-27 Thread Kasun Vithanage
I've a map which has set of keys and pointing to some structs like this. In here i allocate lot of entries and trying to delete them. But the memory usage is not shrinking. According to this issue it seems how go behave at this point. In there its sug