It is correct that you get superpages/hugepages automatically if they are enabled. But your software must also allocate pages in a way which lets the operating system carve out a huge page through a mmap() call (or similar). If the hugepage is 2 megabytes and your garbage collector allocates in 512kilobyte chunks for instance, you don't get the advantage.
The tunable you often want is a way to tell the GC that it should allocate its "carriers[0]" in multiples of 2 megabyte. Does it matter? If you run outside a virtualized environment it does matter quite a lot in some workloads as you can quickly fill a TLB after a shootdown, which then improves the efficiency of the system. For other workloads, I haven't been able to measure any difference. [0] This terminology is taken from Erlang, for the lack of a better definition in Go-land; I don't know too much about the GC internals of Go. The VM allocates a huge page as a "carrier" to the scheduler, and individual processes then carve out process memory from the carrier through a normal allocation strategy such as best-fit. Process memory is garbage collected, extended and released to/from the carrier. On Tue, Sep 5, 2017 at 7:04 PM Pradeep Singh <raute...@gmail.com> wrote: > What is the issue you are facing? > > You do not need to do anything special to enable Hugepages for Go. > Huge page size is a kernel property usually set at Kernel compilation time > or set by your Linux Distribution. > > Go does not care about what the underlying page size is, the page size is > transparent to Go or any other application. > > Unless, you are doing some kind of direct IO or memory mapped voodoo which > require intricate knowledge where your page boundaries are. > > Thanks, > > > On Monday, 4 September 2017 21:17:27 UTC-7, Linker Lin wrote: > >> Hi, Guys! >> I have a lot of docker running go micro-services which have a big-heap. >> My question is how to make go work with hugepagesize in linux/amd64 ? >> Thanks, >> >> -- >> > >> >> *Regards,Linker linlinker...@gmail.com* >> > -- > 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. > -- 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.