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 1qKD1A-00081Q-UP for pgsql-sql@arkaria.postgresql.org; Fri, 14 Jul 2023 07:15:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qKD0B-0002yV-TG for pgsql-sql@arkaria.postgresql.org; Fri, 14 Jul 2023 07:14:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qKD0B-0002yI-KA for pgsql-sql@lists.postgresql.org; Fri, 14 Jul 2023 07:14:07 +0000 Received: from mail-yw1-x112a.google.com ([2607:f8b0:4864:20::112a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qKD03-000KPr-QE for pgsql-sql@lists.postgresql.org; Fri, 14 Jul 2023 07:14:06 +0000 Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-5701eaf0d04so13889527b3.2 for ; Fri, 14 Jul 2023 00:14:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689318840; x=1691910840; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=9UWhPQ98aJD3iIzskKS+cn9vWBc1eAh2IR6f4Ayha88=; b=beEL76Ien0i/aKtqXvtel2MqNR4HSh/c5r4tb+vM2H/cN02RTYZNBsd0KkSPAowMJS W+oEAYajQodYCoySEaZXeoOjxrZowr2lHNcXufE6Rmw20DxOFQCuRzXPBuMnh602++Lt 9Y+gy2SKkbCMqcucCJXKk37MXS5GH95zqukzKQFf5Reb2Vn6VgcKKJrR1gtwhfJU5BnH fUs70t7FMT+eNm5PZFyShrWjSuesbJjgr1O3afZjcr7PWD30xK/pUUMVddBprTgFqBRI wL4/40UMQTd4SutmitvACVIr20CSY3Y8j4mzrkwoDbbs0ZUzl6f1ZqoF/6ZJMg7T4lX0 MikQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689318840; x=1691910840; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9UWhPQ98aJD3iIzskKS+cn9vWBc1eAh2IR6f4Ayha88=; b=kSXAtV0huvT6//8S6ziPwKFgpzw6r1x4ypBAibIdUD7sLAqt3GnBoIrehyexwLh8Y/ qdLmrZajrCHcZRy1Hb3HHR8gIl1mfGoDRvk9gl6mpfg+iO1TaSmY/4DwkyozpnUL7Vzs kA/o3Mb+itVyQ2Jiv0buQP8emhneORri0DAq2m5YXUDuccaJq+HuFLPdirX537HqNI69 h/wXSR/RTqOfxHv/u+RcQD/FeDRHzBdDInIbtZ7mCpFaDYm73jw0cWuQqCvyG4jCjyye hHbKbM1BxlFj87SJrkSt1r8nk5cZhLHWpkNPqEc245cQYrPYEdIedNUJ+XpSzq0Zw9TH xyRw== X-Gm-Message-State: ABy/qLZ+I0PaDU1uSeBU/q5artCsr0+CuZjavfaNmcA0SoF5KoybxB4y jZI1w3cZ0/a50o4KA7ir5CCNhOmgG/Ih1j62Bwg= X-Google-Smtp-Source: APBJJlE5ueFUWSltwck8B8GtkikYkGnwuOAqIH8Z1xupqGUvLyTVy5gcjkRwMTTpUqXMuqdYkh92ZA0MYG7pj4pPx58= X-Received: by 2002:a0d:d647:0:b0:573:2e7a:1733 with SMTP id y68-20020a0dd647000000b005732e7a1733mr3831739ywd.45.1689318840027; Fri, 14 Jul 2023 00:14:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Pavel Stehule Date: Fri, 14 Jul 2023 09:13:23 +0200 Message-ID: Subject: Re: Memory allocation error To: Shaozhong SHI Cc: pgsql-sql Content-Type: multipart/alternative; boundary="0000000000005f4f6f06006d316c" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005f4f6f06006d316c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi p=C3=A1 14. 7. 2023 v 8:38 odes=C3=ADlatel Shaozhong SHI napsal: > A function is being called in a loop. Sometime, there is an error. > > sqlstate: XX000 > NOTICE: message: invalid memory alloc request size 1073741824 > > What to do to resolve the issue? > It depends what you do. Postgres doesn't allow to allocate bigger blocks than 1GB. Maybe you create too big string or too big value of some other type. But it can be signal of some cache bloating. Can you show source code? Can you use gdb, attach to Postgres, place breakpoint to this error message, and when you get this error, send stack trace? Regards Pavel > > Regards, > > David > --0000000000005f4f6f06006d316c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

p=C3=A1 14. 7. 2023 v=C2=A08:38 odes=C3=ADlat= el Shaozhong SHI <shishaozhong= @gmail.com> napsal:
A function is being called in = a loop.=C2=A0 Sometime, there is an error.

sqlstate= : XX000
NOTICE:=C2=A0 message: invalid memory alloc request size = 1073741824

What to do to resolve the issue?<= /div>

It depends what you do. Postgr= es doesn't allow to allocate bigger blocks than 1GB. Maybe you create t= oo big string or too big value of some other type. But it can be signal of = some cache bloating.

Can you show source code? Can you use gdb, attach to Po= stgres, place breakpoint to this error message, and when you get this error= , send stack trace?

Regards

Pavel

=C2=A0

Regards,
<= div>
David
--0000000000005f4f6f06006d316c--