From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-2.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,SPF_PASS,T_DKIM_INVALID shortcircuit=no autolearn=no autolearn_force=no version=3.4.0 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id CEB4F20286 for ; Thu, 7 Sep 2017 00:20:06 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 3097A12085A; Thu, 7 Sep 2017 09:20:04 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 48414120856 for ; Thu, 7 Sep 2017 09:20:01 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=sVzFlweAlKCGbOQ3JTVaF52D1Hk=; b=wZF0MntdtwEtsLF09U wr9Ombemx1CGZ4LboXCalUsKQWF+4mNcIZLftxLEtMzc8iL/4JOkAVfyCTZwgvyY fKhMpiU2K6xH5qtEvWK1waOVPijKIH5QGmuqw4uUlwGMtpnU9EgtoJRmclJu1J9k AzjPPopsHzbBUSJEzLB5TKNEE= Received: by filter0018p3mdw1.sendgrid.net with SMTP id filter0018p3mdw1-15463-59B090AE-14 2017-09-07 00:19:58.662310473 +0000 UTC Received: from herokuapp.com (ec2-54-81-93-244.compute-1.amazonaws.com [54.81.93.244]) by ismtpd0005p1iad1.sendgrid.net (SG) with ESMTP id 0BSLsgYQRH6ea1RmvfjdSQ for ; Thu, 07 Sep 2017 00:19:58.642 +0000 (UTC) Date: Thu, 07 Sep 2017 00:19:59 +0000 (UTC) From: xkernigh@netscape.net To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 57754 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13846 X-Redmine-Issue-Author: parhs X-Redmine-Sender: kernigh X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS74R403ir9SszoHTRVGB3n9MfjSIXrHnxsT0c BVC0tEdDOs/W/2i2Qjp9bsxTPcTTumbJGYuyrbAfxUItvk4m52htCw5moiED0yp2wFTCQDQV3giIDg KPS19wj4ms8C3N3i0S6u9pEeeTa/6QQYod/zLZ7sGH2PLInOjEGDhGHySA== X-ML-Name: ruby-core X-Mail-Count: 82685 Subject: [ruby-core:82685] [Ruby trunk Bug#13846] Openbsd possible memory leak when using Thread X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #13846 has been updated by kernigh (George Koehler). I can reproduce this bug in 2.3 and 2.4 but not in trunk. I am using 2.3 and 2.4 from OpenBSD packages. I compiled trunk from source. ``` $ dmesg | head -2 OpenBSD 6.1 (GENERIC.MP) #19: Thu Aug 3 14:59:44 CEST 2017 robert@syspatch-61-amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP $ ruby -v ruby 2.5.0dev (2017-09-06 trunk 59764) [x86_64-openbsd6.1] $ ruby24 -v ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-openbsd] $ ruby23 -v ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-openbsd] ``` I run the loop in trunk ruby for some minutes, then watch the RES in top(1). It stays at 11M: ``` PID USERNAME PRI NICE SIZE RES STATE WAIT TIME CPU COMMAND 16837 kernigh 64 0 11M 11M onproc/0 - 6:50 94.73% ruby ``` When I run the loop in ruby23 or ruby24, I can see RES increasing slowly from 11M to 12M, 13M, and so on. The bug might be in Ruby 2.3 and 2.4, but not in Ruby trunk and not in OpenBSD's thread library. ---------------------------------------- Bug #13846: Openbsd possible memory leak when using Thread https://bugs.ruby-lang.org/issues/13846#change-66519 * Author: parhs (Coding Gorilla) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: 2.3.4 * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- On openBSD 5.9/6.1 running this code causes RSS memory to increase without limit. This does not happen in ubuntu or other linux. ~~~ ruby loop do thr = Thread.new { puts "thread test" } thr.join GC.start end ~~~ This is related to other things too, like when calling Open3.* , virtually everything that is using threads... I have attached a screenshot with RSS memory plot I did. ---Files-------------------------------- Screen Shot 2017-08-29 at 11.11.42 AM.png (51.7 KB) -- https://bugs.ruby-lang.org/