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 1o5bqk-0002ld-8Z for pgsql-general@arkaria.postgresql.org; Sun, 26 Jun 2022 23:39:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o5bqh-0000j8-UV for pgsql-general@arkaria.postgresql.org; Sun, 26 Jun 2022 23:39:27 +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 1o5bqh-0000dv-HN for pgsql-general@lists.postgresql.org; Sun, 26 Jun 2022 23:39:27 +0000 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o5bqe-0008LJ-Kv for pgsql-general@lists.postgresql.org; Sun, 26 Jun 2022 23:39:27 +0000 Received: by mail-qk1-x731.google.com with SMTP id k10so5835546qke.9 for ; Sun, 26 Jun 2022 16:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to; bh=hTb0OBsIwmqxeOSNfWDBTkJoec9Q9PA2mib8Yw1pte4=; b=jevj8G883X1gd4uA05FtJtAqx0F8Jwks1k7/b9CY1niH+5fhThbdQ3Tpt5eqX59p2A gZ5xlgJg9KRqQd+GtznU9XrK/g9SHbLoU6uvihp9c0YweFzgHjJjbat3N0js6eH4CF1v S6/qqkdOQuZGT3ppklJwbNgs11LQmf2LQMez2nnXWxWrzU3zag17MPRldu1uGrEcfHB6 9DC45h0s/DSs4U82OGho2ONxcAYh6c4nb/rSQ5Fzssnyw4n3lo0ul7U/FqZYNwoHC4Dc niF99010asaGkXFZulTKFd95nuFK7MV41VpmPq3y7nvnWFKbCJMpp6JM+/XzBPXOo14E ocBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to; bh=hTb0OBsIwmqxeOSNfWDBTkJoec9Q9PA2mib8Yw1pte4=; b=DAmLC2H2QcbUdrOqGe3fL9Q6JZ3EBKuuIDtkxTClr6Rg2Pm93db5IwCyTkKGe3XNyK 5vMywt8MidpTHEG9AdSuzJ/+QPi6V+n49naRtAY65BeViiqiic0M0l+4RpTyFzYFeZvR AyJECPW17GXU01uYyK+Eee6jptPENrTkzi37lpHfU65NxY1K/Kv8vNvO8EWgQXL4nUP0 sbzHTzwwB1pzcFHnMn/vVM9FBkwuKZUGnWr2zYH36vQWRD0NO4EhxyBeku6kSIl+yGWQ 6BJ320R9PRm8bmG/4pabbwrPAW2Niq+EFT23tWjI2Dtx0B44YnyG2APFnoGXPyPIYtij 4LTg== X-Gm-Message-State: AJIora9CqNUxY/dI9vzXYQa/XKUsnxZ9/tkVoRPCgX7ZVKU/uUE1aErO TQ5SXHXOkSBfsOUxUslOqPkjGnKTvuMJ+g== X-Google-Smtp-Source: AGRyM1ssqK9znXkhElH4YgCZR+AnSnvnlb2yjmtrX6zkwf8AW+yGosdie0/3jMaAuTwnnc+II3wY9w== X-Received: by 2002:a05:620a:2409:b0:6a7:641:a9d7 with SMTP id d9-20020a05620a240900b006a70641a9d7mr6244673qkn.132.1656286761855; Sun, 26 Jun 2022 16:39:21 -0700 (PDT) Received: from [192.168.2.100] (pool-72-79-19-93.nwrknj.east.verizon.net. [72.79.19.93]) by smtp.gmail.com with ESMTPSA id s10-20020a05620a254a00b006a6d74f8fc9sm8059432qko.127.2022.06.26.16.39.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Jun 2022 16:39:21 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------ath2b0iFbrBdcvsjWu2ZdJgs" Message-ID: Date: Sun, 26 Jun 2022 19:39:20 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: How can I set up Postgres to use given amount of RAM? Content-Language: en-US To: pgsql-general@lists.postgresql.org References: From: Mladen Gogala In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------ath2b0iFbrBdcvsjWu2ZdJgs Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 6/26/22 14:40, W.P. wrote: > Question in topic: > > "How can I set up Postgres to use given amount of RAM?" > > I have now laptop with 8GB of RAM, i can see Linux uses no more than > 2-3GB. > > So my question is how to FORCE PostgreSQL > > use let's say 2-4Ghow to B of RAM for caching tablesĀ  I run queries on? > > As I can see disk actity running queries. > > > W.P.. > > > I would try docker with --memory option. An alternative is to create a VM with the given amount of memory. If your laptop is memory starved, then creating a VM is probably not an option. Docker is much cheaper. Dockerfile is relatively simple to master and you can use Docker to run almost anything. Regards -- Mladen Gogala Database Consultant Tel: (347) 321-1217 https://dbwhisperer.wordpress.com --------------ath2b0iFbrBdcvsjWu2ZdJgs Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 6/26/22 14:40, W.P. wrote:
Question in topic:

"How can I set up Postgres to use given amount of RAM?"

I have now laptop with 8GB of RAM, i can see Linux uses no more than 2-3GB.

So my question is how to FORCE PostgreSQL

use let's say 2-4Ghow to B of RAM for caching tablesĀ  I run queries on?

As I can see disk actity running queries.


W.P..



I would try docker with --memory option. An alternative is to create a VM with the given amount of memory. If your laptop is memory starved, then creating a VM is probably not an option. Docker is much cheaper. Dockerfile is relatively simple to master and you can use Docker to run almost anything.

Regards

-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com
--------------ath2b0iFbrBdcvsjWu2ZdJgs--