From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Milan_Stanojevi=C4=87?= Newsgroups: gmane.emacs.devel Subject: emacs modules memory leak in 27 Date: Mon, 20 Jul 2020 12:41:35 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2665"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jul 20 19:14:49 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jxZNI-0000Xg-Sl for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Jul 2020 19:14:48 +0200 Original-Received: from localhost ([::1]:50780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jxZNH-00039G-W3 for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Jul 2020 13:14:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jxYrq-0000Ap-67 for emacs-devel@gnu.org; Mon, 20 Jul 2020 12:42:18 -0400 Original-Received: from mxout1.mail.janestreet.com ([38.105.200.78]:53759) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jxYro-0007BM-Av for emacs-devel@gnu.org; Mon, 20 Jul 2020 12:42:17 -0400 X-JS-Received: from [30.32.81.38] (helo=igm-qpr-mailcore1) by mxout1.mail.janestreet.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94) (envelope-from ) id 1jxYrm-0000PM-7g for emacs-devel@gnu.org; Mon, 20 Jul 2020 12:42:14 -0400 X-JS-Flow: external X-JS-Received: by igm-qpr-mailcore1 with ocaml/mailcore/main_production (d5298a6170a2) (envelope-from ) id BfFclm-eJP5oA-G-; 2020-07-20 12:42:14.230139-04:00 X-JS-Scanner-attachment: No attachments X-JS-Scanner-esets: Not scanned (internal mail) Original-Received: from mail-wr1-f72.google.com ([209.85.221.72]) by mxgoog2.mail.janestreet.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.94) id 1jxYrk-0004Vb-RJ for emacs-devel@gnu.org; Mon, 20 Jul 2020 12:42:12 -0400 Original-Received: by mail-wr1-f72.google.com with SMTP id s16so12281018wrv.1 for ; Mon, 20 Jul 2020 09:42:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:from:date:message-id:subject:to; bh=7iQ25AW+uixge4sv1x+rNNuNl113p+LKJSfgbhNf4JM=; b=fGfDQQstkIWAoD14iflZtcghWhB5VJHZoah7pwB4gNLx5tEBPsx3hdsGz3Nsjh9re8 lSdELYgloKXW5ODI+iGUnGiw1WKRl2bj7IAY1U4lArlIhFWrmi0v4R2rXYugSrGbSbs3 UXNszyFnjSaRbhIMITzQTrapr+S2Iyt6TP3ZI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=7iQ25AW+uixge4sv1x+rNNuNl113p+LKJSfgbhNf4JM=; b=kqx+9J0OuP3kd+NiAd2rUyPbsMjBsAxzpBJUIMDRLZd9076TZBvu01UJHc982bGxpJ HhfdItTjS9cv5xqPP1iNgj71KqwO+W+mujrF2V77bRzkWtzgajoTTZRJjhtl6vqSqdyd YmtJmEkICfo+d3vJ7dDpQ8491uWBmz0MfVWqsLZdYjG5QgjUCdnt5RYJbOYznNHxe6YS ilF2meYYYEetv9Hul3vfHbNRnyftJSqZOL8G6aADu1pwR1zpy5x95eLGy1EPuEFIq4WC aw+HY313jqQpHw9ZQDBjQgrOxLlG4Y1P2qXDR3SV/Ab3IcXDT7okpqL1JfMTzBnaMAJn W9tg== X-Gm-Message-State: AOAM5325WnemAMyk8znVMrni8GwefwOtjNQUqj5s5rnWN/bfVH87ar7R 8k0LEETypS4qjBrh92ARS2jQ9IwCP5eORQtkmysPyky4tLOWPt+v69+0bj9bAaMGe+HCW+XqA9M z0k+k8BhEtdKvfpOZbY3w7YaH8dg= X-Received: by 2002:a5d:650e:: with SMTP id x14mr24056375wru.187.1595263331881; Mon, 20 Jul 2020 09:42:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwa/IXfpR59BbELLmSoty8fND7MBJFGouQhDsa5apsI0pfQ/1QUBqJunX8zsAvwdf5Z/2vZHx/ErEidPnFldbc= X-Received: by 2002:a5d:650e:: with SMTP id x14mr24056352wru.187.1595263331549; Mon, 20 Jul 2020 09:42:11 -0700 (PDT) X-JS-Exim-Data-Received: 2020-07-20 12:42:12-0400 X-JS-Processed-by: mailcore Received-SPF: pass client-ip=38.105.200.78; envelope-from=mstanojevic@janestreet.com; helo=mxout1.mail.janestreet.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/20 12:42:15 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 20 Jul 2020 13:14:07 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:253123 Archived-At: This is on emacs-27 branch. env-make_global_ref will add a reference to the underlying Lisp_Object and allocate emacs_value from the global storage. env->free_global_ref on the other hand will only remove a reference to the underlying Lisp_Object and not free the emacs_value. The global storage of emacs_values seems to be only growing and is never collected (and I think with the current array implementation it is probably not possible to collect). This leak is not present in 26 and I think the leak was introduced with the change in the underlying representation of emacs_value. (If I'm reading git history right, since 26 this was changed and then reverted and then changed again).