How about turning off gc during execution of work? gc will be enabled after works done. my sight was narrow?
if lots of small object is created and is free, consider sync.Pool, which would prevent the program from wasting allocation overhead. 2016년 7월 9일 토요일 오후 2시 11분 49초 UTC+9, Arthur 님의 말: > > my program allocates many different kinds of small object, and that gives > GC a lot pressure. > so I wan't to make a big slice and split object from it manually. > > block = make([]byte, 30*1024) > myObj := (*myObjType)(unsafe.Pointer(&block[offset])) > > I write a simple allocator to do it, but I meet strange panic. > so my question is, can't go alloc custom objects from byte slice's memory > address? > -- 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, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.