Re: Find how much memory is postgres using

From: Nik Tek <niktek2005(at)gmail(dot)com>
To: Hubert Lubaczewski <depesz(at)depesz(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Find how much memory is postgres using
Date: 2013-04-09 18:24:22
Message-ID: CAHySzWUQdaWCydg3EQ1CU1i9G6YeZS4iJoVjKApPb9P5oAXrJQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-performance

--For MSSQL
select
(select cntr_value
from sys.dm_os_performance_counters
where object_name like '%Memory Manager%' and counter_name like
'Maximum Workspace Memory (KB)%') as Maximum_Workspace_Memory_KB,
(select cntr_value
from sys.dm_os_performance_counters
where object_name like '%Memory Manager%' and counter_name like
'Target Server Memory (KB)%') as Target_Server_Memory_KB,
(select cntr_value
from sys.dm_os_performance_counters
where object_name like '%Memory Manager%' and counter_name like
'Maximum Workspace Memory (KB)%') * 100.0
/
(select cntr_value
from sys.dm_os_performance_counters
where object_name like '%Memory Manager%' and counter_name like
'Target Server Memory (KB)%') as Ratio

-- Oracle
SELECT sum(bytes)/1024/1024
FROM v$sgastat;

Thank you
Nik

On Mon, Apr 8, 2013 at 3:18 AM, hubert depesz lubaczewski <depesz(at)depesz(dot)com
> wrote:

> On Sun, Apr 07, 2013 at 09:27:42PM -0700, Nik Tek wrote:
> > Thank you Depesz!
> > But I have a naive question, why isn't a straight forword approach for
> > postgres, unlike Oracle or MSSQL?
>
> No idea. And how do you get memory usage in Oracle or MSSQL?
>
> Best regards,
>
> depesz
>
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message hubert depesz lubaczewski 2013-04-09 18:34:07 Re: Find how much memory is postgres using
Previous Message bricklen 2013-04-09 02:12:26 Re: High growth company seeks postgres DBA

Browse pgsql-performance by date

  From Date Subject
Next Message hubert depesz lubaczewski 2013-04-09 18:34:07 Re: Find how much memory is postgres using
Previous Message Dave Johansen 2013-04-08 21:10:53 Re: Picking out the most recent row using a time stamp column