Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
16GB memory limit on amd64
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  20 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jingcheng Zhang  
View profile  
 More options Aug 31 2012, 11:58 pm
From: Jingcheng Zhang <dio...@gmail.com>
Date: Sat, 1 Sep 2012 11:58:40 +0800
Local: Fri, Aug 31 2012 11:58 pm
Subject: 16GB memory limit on amd64
Hello gophers,

I'm running a server written in Go. It serves a lot of concurrent
connections, perhaps many millions per process.
Currently I don't know how to measure the accurate memory size used,
and when the process will reach the 16GB memory limit and panics.
The "top" command shows 2574M on VIRT, and 100M on RES.
Will the process panics when "VIRT" reaches 16G ?
Are there any detailed docs on Go's memory usage?

Thanks.

--
Best regards,
Jingcheng Zhang
Beijing, P.R.China


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dave Cheney  
View profile  
 More options Sep 1 2012, 12:06 am
From: Dave Cheney <d...@cheney.net>
Date: Sat, 1 Sep 2012 14:06:17 +1000
Local: Sat, Sep 1 2012 12:06 am
Subject: Re: [go-nuts] 16GB memory limit on amd64

> I'm running a server written in Go. It serves a lot of concurrent
> connections, perhaps many millions per process.
> Currently I don't know how to measure the accurate memory size used,
> and when the process will reach the 16GB memory limit and panics.
> The "top" command shows 2574M on VIRT, and 100M on RES.
> Will the process panics when "VIRT" reaches 16G ?

Assuming you have more than 16Gb of free memory in your machine, and
at no point since the Go process has started it has been subject to
significant paging, then the value reported by top in the RES column
is a reasonable approximation for the amount of memory Go is using at
the moment.

Currently, the maximum size of the 64bit heap is 16Gb. Allocations
that cause the runtime to try to grow the heap above this size will
cause a panic. This limit can be raised by adjusting a few constants
in the runtime. Details are in
http://code.google.com/p/go/issues/detail?id=2142.

> Are there any detailed docs on Go's memory usage?

The best available docs are this mailing list and the source, I
suggest reading runtime/malloc.* and runtime/mgc0.c.

Cheers

Dave


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jingcheng Zhang  
View profile  
 More options Sep 1 2012, 12:25 am
From: Jingcheng Zhang <dio...@gmail.com>
Date: Sat, 1 Sep 2012 12:25:49 +0800
Local: Sat, Sep 1 2012 12:25 am
Subject: Re: [go-nuts] 16GB memory limit on amd64
Hello Dave,

The physical memory size of the machine is 64GB, there is a lot of
free memory left, and the process is not swapping pages.
So the RES column should be the actual memory cost.

I'm reading runtime/malloc.goc but am not clear of the design of the
memory management for runtime.
So if there were some docs illustrating the details of the runtime
memory management it should be awesome.

Thanks a lot!

--
Best regards,
Jingcheng Zhang
Beijing, P.R.China

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dave Cheney  
View profile  
 More options Sep 1 2012, 12:27 am
From: Dave Cheney <d...@cheney.net>
Date: Sat, 1 Sep 2012 14:26:59 +1000
Local: Sat, Sep 1 2012 12:26 am
Subject: Re: [go-nuts] 16GB memory limit on amd64
Others will hopefully correct me, but I believe it is based on tcmalloc.

On 01/09/2012, at 14:25, Jingcheng Zhang <dio...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Pike  
View profile  
 More options Sep 1 2012, 12:35 am
From: Rob Pike <r...@golang.org>
Date: Fri, 31 Aug 2012 21:35:05 -0700
Local: Sat, Sep 1 2012 12:35 am
Subject: Re: [go-nuts] 16GB memory limit on amd64

On Fri, Aug 31, 2012 at 9:26 PM, Dave Cheney <d...@cheney.net> wrote:
> Others will hopefully correct me, but I believe it is based on tcmalloc.

It is.

-rob


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rémy Oudompheng  
View profile  
 More options Sep 1 2012, 12:43 am
From: Rémy Oudompheng <remyoudomph...@gmail.com>
Date: Sat, 1 Sep 2012 06:43:15 +0200
Local: Sat, Sep 1 2012 12:43 am
Subject: Re: [go-nuts] 16GB memory limit on amd64
On 2012/9/1 Dave Cheney <d...@cheney.net> wrote:

> Currently, the maximum size of the 64bit heap is 16Gb. Allocations
> that cause the runtime to try to grow the heap above this size will
> cause a panic. This limit can be raised by adjusting a few constants
> in the runtime. Details are in
> http://code.google.com/p/go/issues/detail?id=2142.

An issue I have encountered is that the threashold for GC triggering
can end up being larger than the memory limit: when it is at 17GB, it
is never reached and you are in a memory leak state.

This is a problem when you have a system, that, for example, keeps
12GB of persistent data in memory, and regularly allocate small chunks
for working. It could be possible to lower GOGC but it doesn't look
like the correct solution. Would it be interesting to lower the growth
of the GC threshold when used memory approaches "the limit" ?

It could also benefit the 32-bit users.

Rémy.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sébastien Paolacci  
View profile  
 More options Sep 1 2012, 3:03 am
From: Sébastien Paolacci <sebastien.paola...@gmail.com>
Date: Sat, 1 Sep 2012 09:03:16 +0200
Local: Sat, Sep 1 2012 3:03 am
Subject: Re: [go-nuts] 16GB memory limit on amd64
Yes it would. A 50% mem increase at 10MB is almost nothing, at 12GB it
just becomes dramatic.

Apart from that corner-case where not hitting the 16GB threshold is a
clearly identifiable target, guessing what is the comfort zone (before
damage) is not so easy.

Smoothing `gcpercent' over [0, min(arena_size,
/proc/meminfo.MemTotal)] might still provide with an additional
protection.

Sebastien

On Sat, Sep 1, 2012 at 6:43 AM, Rémy Oudompheng


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jingcheng Zhang  
View profile  
 More options Sep 6 2012, 11:20 am
From: Jingcheng Zhang <dio...@gmail.com>
Date: Thu, 6 Sep 2012 23:19:50 +0800
Local: Thurs, Sep 6 2012 11:19 am
Subject: Re: [go-nuts] 16GB memory limit on amd64
Our servers will reach 16GB memory limit days later.
I decide to temporarily change the limit to 64GB. After some search on
the go-nuts list, I find a way:

File src/pkg/runtime/malloc.h:

#ifdef _64BIT
        MHeapMap_Bits = 22,
#else
        MHeapMap_Bits = 20,
#endif

Change 22 to 24, and

File src/pkg/runtime/malloc.goc:

                arena_size = 16LL<<30;

Change 16 to 64.

I'm not sure whether this change could work correctly.
Any gophers can confirm this?

Thanks very much!

--
Best regards,
Jingcheng Zhang
Beijing, P.R.China

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
minux  
View profile  
 More options Sep 6 2012, 11:25 am
From: minux <minux...@gmail.com>
Date: Thu, 6 Sep 2012 23:25:01 +0800
Local: Thurs, Sep 6 2012 11:25 am
Subject: Re: [go-nuts] 16GB memory limit on amd64

confirmed. it's correct.

ref: http://code.google.com/p/go/issues/detail?id=2142#c11


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jingcheng Zhang  
View profile  
 More options Sep 6 2012, 11:30 am
From: Jingcheng Zhang <dio...@gmail.com>
Date: Thu, 6 Sep 2012 23:30:19 +0800
Local: Thurs, Sep 6 2012 11:30 am
Subject: Re: [go-nuts] 16GB memory limit on amd64
Hello minux,

Thanks for your fast reply :-)

The comments in the issue also said that this change may cause GC
behaves unexpectedly, or slower, and will cause a "segv" error for
encoding/gob. Is this right? What side effects will these issues bring
to my code?

--
Best regards,
Jingcheng Zhang
Beijing, P.R.China

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
minux  
View profile  
 More options Sep 6 2012, 11:57 am
From: minux <minux...@gmail.com>
Date: Thu, 6 Sep 2012 23:56:45 +0800
Local: Thurs, Sep 6 2012 11:56 am
Subject: Re: [go-nuts] 16GB memory limit on amd64

On Thu, Sep 6, 2012 at 11:30 PM, Jingcheng Zhang <dio...@gmail.com> wrote:
> The comments in the issue also said that this change may cause GC
> behaves unexpectedly, or slower, and will cause a "segv" error for

GC will definitely be slower, as it must scan larger amount of memory.
I'm not aware of the other issues (maybe i don't test that long enough,
but imo this fix won't affect other parts)

you probably should test it before deploying though.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jingcheng Zhang  
View profile  
 More options Sep 6 2012, 12:11 pm
From: Jingcheng Zhang <dio...@gmail.com>
Date: Fri, 7 Sep 2012 00:10:59 +0800
Local: Thurs, Sep 6 2012 12:10 pm
Subject: Re: [go-nuts] 16GB memory limit on amd64
Thanks very much! I'll try it tomorrow.

On Thu, Sep 6, 2012 at 11:56 PM, minux <minux...@gmail.com> wrote:

> On Thu, Sep 6, 2012 at 11:30 PM, Jingcheng Zhang <dio...@gmail.com> wrote:

>> The comments in the issue also said that this change may cause GC
>> behaves unexpectedly, or slower, and will cause a "segv" error for

> GC will definitely be slower, as it must scan larger amount of memory.
> I'm not aware of the other issues (maybe i don't test that long enough,
> but imo this fix won't affect other parts)

> you probably should test it before deploying though.

>> encoding/gob. Is this right? What side effects will these issues bring
>> to my code?

--
Best regards,
Jingcheng Zhang
Beijing, P.R.China

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan Kortschak  
View profile  
 More options Sep 6 2012, 5:58 pm
From: Dan Kortschak <dan.kortsc...@adelaide.edu.au>
Date: Fri, 07 Sep 2012 07:28:28 +0930
Local: Thurs, Sep 6 2012 5:58 pm
Subject: Re: [go-nuts] 16GB memory limit on amd64
We have been using a runtime with the memory limit set to 64GB since I
posted the current work around without any noticeable problems. The main
application that required this makes extensive use of gob, so I can say
that there don't appear to be problem relating to this.

Dan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jingcheng Zhang  
View profile  
 More options Sep 6 2012, 10:25 pm
From: Jingcheng Zhang <dio...@gmail.com>
Date: Fri, 7 Sep 2012 10:25:25 +0800
Local: Thurs, Sep 6 2012 10:25 pm
Subject: Re: [go-nuts] 16GB memory limit on amd64
Hello Dan,

Thanks for your report!
I've rebuilt my Go distribution and my server binaries, it's running
now, I'll keep monitoring it.

On Fri, Sep 7, 2012 at 5:58 AM, Dan Kortschak

--
Best regards,
Jingcheng Zhang
Beijing, P.R.China

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan Kortschak  
View profile  
 More options Sep 6 2012, 10:29 pm
From: Dan Kortschak <dan.kortsc...@adelaide.edu.au>
Date: Fri, 07 Sep 2012 11:59:30 +0930
Local: Thurs, Sep 6 2012 10:29 pm
Subject: Re: [go-nuts] 16GB memory limit on amd64
I'll just clarify, we use gob on small types and not in collections.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jingcheng Zhang  
View profile  
 More options Sep 6 2012, 10:39 pm
From: Jingcheng Zhang <dio...@gmail.com>
Date: Fri, 7 Sep 2012 10:39:30 +0800
Local: Thurs, Sep 6 2012 10:39 pm
Subject: Re: [go-nuts] 16GB memory limit on amd64
Thanks Dan.

And Hello Rob, could you confirm the change has no side-effects on
"encoding/gob" ?

On Fri, Sep 7, 2012 at 10:29 AM, Dan Kortschak

<dan.kortsc...@adelaide.edu.au> wrote:
> I'll just clarify, we use gob on small types and not in collections.

> On Fri, 2012-09-07 at 10:25 +0800, Jingcheng Zhang wrote:
>> Hello Dan,

>> Thanks for your report!
>> I've rebuilt my Go distribution and my server binaries, it's running
>> now, I'll keep monitoring it.

--
Best regards,
Jingcheng Zhang
Beijing, P.R.China

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob Pike  
View profile  
 More options Sep 6 2012, 11:54 pm
From: Rob Pike <r...@golang.org>
Date: Thu, 6 Sep 2012 20:54:16 -0700
Local: Thurs, Sep 6 2012 11:54 pm
Subject: Re: [go-nuts] 16GB memory limit on amd64
Changing the arena size should have no effect on encoding/gob.

-rob


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jingcheng Zhang  
View profile  
 More options Sep 7 2012, 12:23 am
From: Jingcheng Zhang <dio...@gmail.com>
Date: Fri, 7 Sep 2012 12:23:36 +0800
Local: Fri, Sep 7 2012 12:23 am
Subject: Re: [go-nuts] 16GB memory limit on amd64
Thanks very much :-)

On Fri, Sep 7, 2012 at 11:54 AM, Rob Pike <r...@golang.org> wrote:
> Changing the arena size should have no effect on encoding/gob.

> -rob

--
Best regards,
Jingcheng Zhang
Beijing, P.R.China

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
 
View profile  
 More options Sep 7 2012, 7:36 am
From: ⚛ <0xe2.0x9a.0...@gmail.com>
Date: Fri, 7 Sep 2012 04:36:02 -0700 (PDT)
Local: Fri, Sep 7 2012 7:36 am
Subject: Re: [go-nuts] 16GB memory limit on amd64

On Thursday, September 6, 2012 5:20:03 PM UTC+2, Jingcheng Zhang wrote:
> Our servers will reach 16GB memory limit days later.
> I decide to temporarily change the limit to 64GB.

Is there a reason why the memory usage of the program is going from zero to
16GB? From your description it seems that letting the program run for 1
month would result in 100GB memory usage.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jingcheng Zhang  
View profile  
 More options Sep 7 2012, 11:27 am
From: Jingcheng Zhang <dio...@gmail.com>
Date: Fri, 7 Sep 2012 23:27:51 +0800
Local: Fri, Sep 7 2012 11:27 am
Subject: Re: [go-nuts] 16GB memory limit on amd64
Our users are increasing everyday, causing a lot of memory used.
On the other hand, there may be some memory leaks or resource leaks in
our code, so increasing the limit gives us much time to tackle the
issues.

On Fri, Sep 7, 2012 at 7:36 PM, ⚛ <0xe2.0x9a.0...@gmail.com> wrote:
> On Thursday, September 6, 2012 5:20:03 PM UTC+2, Jingcheng Zhang wrote:

>> Our servers will reach 16GB memory limit days later.
>> I decide to temporarily change the limit to 64GB.

> Is there a reason why the memory usage of the program is going from zero to
> 16GB? From your description it seems that letting the program run for 1
> month would result in 100GB memory usage.

--
Best regards,
Jingcheng Zhang
Beijing, P.R.China

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »