Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lmfyQ-00026Z-MN for pgsql-hackers@arkaria.postgresql.org; Fri, 28 May 2021 17:08:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lmfyP-0005aa-Fc for pgsql-hackers@arkaria.postgresql.org; Fri, 28 May 2021 17:08:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lmfyP-0005aL-4n for pgsql-hackers@lists.postgresql.org; Fri, 28 May 2021 17:08:37 +0000 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lmfyM-0000Vs-GE for pgsql-hackers@postgresql.org; Fri, 28 May 2021 17:08:36 +0000 Received: by mail-oi1-x22a.google.com with SMTP id x15so4889388oic.13 for ; Fri, 28 May 2021 10:08:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :in-reply-to:user-agent; bh=MGM2mJPJ/yw39gRWggtsNEvJkh4z8LisfkKlGvg/64Y=; b=OMDi7x8zznRR3mLV1rfMm438dXsIzDp75eOOQ4WELSBiLwkRAFvCv8daugo8lGCrEv 1SZMOSpKQFrhc6jsFjNJq1lJPnZfqNRCiCxY1owbX9B8t51yQmmEO/yP0yvdp/ppzmW4 Hotf1AVmAWdt/r1JQ02gj51DhR7Ew1LJoauGTQBfQsOvh/nXr7TR/32uDhUjVK3o1exQ VQGjphIpiyBEDaTKeMKp7Zpor6DxC0IEVLBVIoR7h6XmVzk6BKvHva5VJnqTKXk0xl++ U6EZJtF/xNVmsXBOtSDE4GpxR5PIfi/UuHp0jMxBM67/HxSTw7jW84OW0wDPZf1HUuQB njsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:in-reply-to:user-agent; bh=MGM2mJPJ/yw39gRWggtsNEvJkh4z8LisfkKlGvg/64Y=; b=sVimz/3l5x8jBPHbojzGPNiYSMqQ1iQmJu/x6e0lH6foZVOiek4ujJ7nPD2B7m84jr gm734vkANarU0mjEWMOUWqLLvoY8nbACbMjtp8KJhqDUouvgyisyGnafu/oP5JGocarg jYg/SXFYuWCfiLAT2ovjVrHL5j+DG0z9hfY4t2QB5QJ+NmPiTd1VFAVhBQkXR1xMrfxQ Q1lTsYhaZe0DkKUjxI7rrzkx/CtZIupz8xpMIbAng1JlE/90m1YUg8FyfViP/jiyNQrp a0xr7zASW97db2GFUNwsk5EpPLrUrkkDmYLC3XKlMtbXH3xvzNCOgj/UEpEC0YmNjRur 1KAg== X-Gm-Message-State: AOAM533vUNRkpTJt19uSJhYAnmIwbk4H7O+Qj51u7VpgcTsLYt2EJLiv XMCqKbf3Ov3f1VplYbEUX3khKrSowsFSVw== X-Google-Smtp-Source: ABdhPJzqMOy3hqB5+XS6ECtnBPNYGF13k4HhQMHfSPsoRUboFtkpjWzjtzCgUZa/G0T3okuLhy20fQ== X-Received: by 2002:aca:494d:: with SMTP id w74mr6741192oia.47.1622221711920; Fri, 28 May 2021 10:08:31 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id x63sm1219903oix.47.2021.05.28.10.08.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 May 2021 10:08:31 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id C346A8007F8; Fri, 28 May 2021 12:08:29 -0500 (CDT) Date: Fri, 28 May 2021 12:08:29 -0500 From: Justin Pryzby To: Andres Freund Cc: pgsql-hackers@postgresql.org, Tom Lane Subject: Re: terminate called after throwing an instance of 'std::bad_alloc' Message-ID: <20210528170829.GK2082@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210517002936.GD373@telsasoft.com> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk There's a memory leak affecting JIT expressions, even when inlining, optimization, and tuple deforming are disabled. The server that got OOM after installing PG13.3 (because your patch wasn't applied) still gets OOM even with inline_above_cost=-1, optimize_above_cost=-1, and deforming=off. Actually I think this is an even more severe leak, even though it seems to be infrequent. The inlining leak is slow enough that I don't think that it, alone, would cause a crash. It's possible there's a race condition or something that makes this hard to notice or reproduce, or the inlining leak is just easier to find. I guess your patch avoids this issue, too, since it didn't OOM with your patch. -- Justin