Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5F7B3200CA8 for ; Wed, 31 May 2017 15:02:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5E31D160BBA; Wed, 31 May 2017 13:02:08 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id AE195160BCB for ; Wed, 31 May 2017 15:02:07 +0200 (CEST) Received: (qmail 26593 invoked by uid 500); 31 May 2017 13:02:06 -0000 Mailing-List: contact dev-help@thrift.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@thrift.apache.org Delivered-To: mailing list dev@thrift.apache.org Received: (qmail 26576 invoked by uid 99); 31 May 2017 13:02:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 May 2017 13:02:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 72756180370 for ; Wed, 31 May 2017 13:02:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id JC7sCJhekHnk for ; Wed, 31 May 2017 13:02:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id EE4B45FCC4 for ; Wed, 31 May 2017 13:02:04 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 76EA2E0BDE for ; Wed, 31 May 2017 13:02:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 2D84121B58 for ; Wed, 31 May 2017 13:02:04 +0000 (UTC) Date: Wed, 31 May 2017 13:02:04 +0000 (UTC) From: "Can Celasun (JIRA)" To: dev@thrift.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (THRIFT-4105) used too much memory randomly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 31 May 2017 13:02:08 -0000 [ https://issues.apache.org/jira/browse/THRIFT-4105?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Can Celasun closed THRIFT-4105. ------------------------------- Resolution: Not A Bug > used too much memory randomly > ----------------------------- > > Key: THRIFT-4105 > URL: https://issues.apache.org/jira/browse/THRIFT-4105 > Project: Thrift > Issue Type: Bug > Components: Go - Library > Reporter: chengning > Priority: Critical > Attachments: pprof.txt > > > In my golang project used thrift, high memory usage once or twice a week. > Use go tool pprof can find the following information. > We did not use thrift to pass larger strings, but they allocate a string with the size of 352.20MB > I think there may be a problem > (pprof) top > 704.39MB of 709.32MB total (99.31%) > Dropped 215 nodes (cum <= 3.55MB) > flat flat% sum% cum cum% > 704.39MB 99.31% 99.31% 704.39MB 99.31% git.apache.org/thrift.git/lib/go/thrift.(*TBinaryProtocol).readStringBody > 0 0% 99.31% 704.39MB 99.31% git.apache.org/thrift.git/lib/go/thrift.(*TBinaryProtocol).ReadMessageBegin > 0 0% 99.31% 705.03MB 99.39% git.apache.org/thrift.git/lib/go/thrift.(*TSimpleServer).AcceptLoop.func1 > 0 0% 99.31% 705.03MB 99.39% git.apache.org/thrift.git/lib/go/thrift.(*TSimpleServer).processRequests > 0 0% 99.31% 705.03MB 99.39% cn.com/rpc_server/thrift.(*VideoCallThriftProcessor).Process > 0 0% 99.31% 708.82MB 99.93% runtime.goexit > (pprof) list readStringBody > Total: 709.32MB > ROUTINE ======================== git.apache.org/thrift.git/lib/go/thrift.(*TBinaryProtocol).readStringBody in /src/git.apache.org/thrift.git/lib/go/thrift/binary_protocol.go > 704.39MB 704.39MB (flat, cum) 99.31% of Total > . . 482: } > . . 483: var buf []byte > . . 484: if int(size) <= len(p.buffer) { > . . 485: buf = p.buffer[0:size] > . . 486: } else { > 352.20MB 352.20MB 487: buf = make([]byte, size) > . . 488: } > . . 489: _, e := io.ReadFull(p.trans, buf) > 352.20MB 352.20MB 490: return string(buf), NewTProtocolException(e) > . . 491:} > (pprof) list ReadMessageBegin > Total: 709.32MB > ROUTINE ======================== git.apache.org/thrift.git/lib/go/thrift.(*TBinaryProtocol).ReadMessageBegin in /src/git.apache.org/thrift.git/lib/go/thrift/binary_protocol.go > 0 704.39MB (flat, cum) 99.31% of Total > . . 256: return name, typeId, seqId, nil > . . 257: } > . . 258: if p.strictRead { > . . 259: return name, typeId, seqId, NewTProtocolExceptionWithType(BAD_VERSION, fmt.Errorf("Missing version in ReadMessageBegin")) > . . 260: } > . 704.39MB 261: name, e2 := p.readStringBody(size) > . . 262: if e2 != nil { > . . 263: return name, typeId, seqId, e2 > . . 264: } > . . 265: b, e3 := p.ReadByte() > . . 266: if e3 != nil { -- This message was sent by Atlassian JIRA (v6.3.15#6346)