[ 
https://issues.apache.org/jira/browse/THRIFT-3241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14641726#comment-14641726
 ] 

Adam Beberg commented on THRIFT-3241:
-------------------------------------

It is by design, and is considered a production issue.

1. Run with X memory.
2. Max out the load, and observe memory use.
3. Use less memory the next run if there is significant unused memory, more if 
they are OOM'ing.
4. If you cannot raise memory, lower the concurrency per server.

Steps 1-3 are completely automated in Google production systems and elsewhere.

So in Thrift what's important is exposing the concurrency limits in all 
pool/async implementations. In Go LimitListener is useful.

> fatal error: runtime: cannot map pages in arena address space
> -------------------------------------------------------------
>
>                 Key: THRIFT-3241
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3241
>             Project: Thrift
>          Issue Type: Bug
>          Components: Go - Library
>    Affects Versions: 0.9.2
>            Reporter: Jens Geyer
>            Priority: Blocker
>
> Passing huge strings to a Go server may produce a fatal exit with an OOM 
> error. Main problem is that [OOM errors are not recoverable by 
> design|(https://groups.google.com/forum/#!msg/golang-nuts/jMpUBTkif3s/Luhrm0ZnHQcJ]
>  in Go.
> {code}
> fatal error: runtime: cannot map pages in arena address space
> runtime stack:
> runtime.SysMap(0x3e7e0000, 0xb0d0000, 0xcfe01, 0x8172d8)
>         c:/go/src/runtime/mem_windows.c:131 +0x7f
> runtime.MHeap_SysAlloc(0x81a0c0, 0xb0d0000, 0xfffffffe)
>         c:/go/src/runtime/malloc.c:284 +0xf1
> runtime.MHeap_Alloc(0x81a0c0, 0x5861, 0x0, 0x12360001, 0x12368640)
>         c:/go/src/runtime/mheap.c:240 +0x66
> goroutine 390 [running]:
> runtime.switchtoM()
>         c:/go/src/runtime/asm_386.s:208 fp=0x1241fb70 sp=0x1241fb6c
> runtime.mallocgc(0xb0c000b, 0x0, 0x3, 0x12356960)
>         c:/go/src/runtime/malloc.go:199 +0x7d3 fp=0x1241fbc8 sp=0x1241fb70
> runtime.rawstring(0xb0c000b, 0x0, 0x0, 0x0, 0x0, 0x0)
>         c:/go/src/runtime/string.go:195 +0x88 fp=0x1241fbe0 sp=0x1241fbc8
> runtime.slicebytetostring(0x1dbcc000, 0xb0c000b, 0xb0c000b, 0x0, 0x0)
>         c:/go/src/runtime/string.go:69 +0x38 fp=0x1241fc28 sp=0x1241fbe0
> thrift.(*TBinaryProtocol).readStringBody(0x12418c40, 0xb0c000b, 0x0, 0x0, 
> 0x0, 0x0)
>         C:/Test/src/thrift/binary_protocol.go:483 +0x150 fp=0x1241fc70 
> sp=0x1241fc28
> thrift.(*TBinaryProtocol).ReadString(0x12418c40, 0x0, 0x0, 0x0, 0x0)
>         C:/Test/src/thrift/binary_protocol.go:437 +0xc6 fp=0x1241fc94 
> sp=0x1241fc70
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to