FAQ
Newly created variable may be created from other functions that returns a
pointer.

If not so, how to avoid heap allocation to decrease garbage collection
frequency?

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Nvcnvn at Feb 12, 2013 at 11:48 am
    Don't create a pointer when you don't need it?
    I think you should not worry about that in almost all normal case! Just
    remember to close some think that you opened.


    Vào 18:06:08 UTC+7 Thứ ba, ngày 12 tháng hai năm 2013, Ewan Chou đã viết:
    Newly created variable may be created from other functions that returns a
    pointer.

    If not so, how to avoid heap allocation to decrease garbage collection
    frequency?
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Ewan Chou at Feb 12, 2013 at 2:24 pm
    I find out that every http request generates about 4KB garbage at minimum.

    http://play.golang.org/p/_SWB090LfL

    So there is no way to allocate everything on stack.
    On Tuesday, February 12, 2013 7:48:13 PM UTC+8, nvcnvn wrote:

    Don't create a pointer when you don't need it?
    I think you should not worry about that in almost all normal case! Just
    remember to close some think that you opened.


    Vào 18:06:08 UTC+7 Thứ ba, ngày 12 tháng hai năm 2013, Ewan Chou đã viết:
    Newly created variable may be created from other functions that returns a
    pointer.

    If not so, how to avoid heap allocation to decrease garbage collection
    frequency?
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • John Nagle at Feb 12, 2013 at 7:38 pm

    On 2/12/2013 6:24 AM, Ewan Chou wrote:
    I find out that every http request generates about 4KB garbage at minimum.

    http://play.golang.org/p/_SWB090LfL

    So there is no way to allocate everything on stack.
    All variable-sized objects, including strings, are
    probably heap-allocated.

    John Nagle

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 12, '13 at 11:06a
activeFeb 12, '13 at 7:38p
posts4
users3
websitegolang.org

3 users in discussion

Ewan Chou: 2 posts Nvcnvn: 1 post John Nagle: 1 post

People

Translate

site design / logo © 2021 Grokbase