Re: Find how much memory is postgres using

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--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@xxxxxxxxxx> 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



[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux