I'm interested to expose output of the remaining (memory) fields from getrusage().
postgres=# SET log_parser_stats='on'; postgres=# SELECT c.oid::regclass, usagecount FROM pg_buffercache b JOIN pg_class c USING (relfilenode) WHERE usagecount=1 ; LOG: PARSER STATISTICS DETAIL: ! system usage stats: ! 0.000197 elapsed 0.000119 user 0.000079 system sec ! [0.011572 user 0.007714 sys total] ! 0/0 [0/264] filesystem blocks in/out ! 0/39 [0/989] page faults/reclaims, 0 [0] swaps ! 0 [0] signals rcvd, 0/0 [0/0] messages rcvd/sent ! 0/0 [2/2] voluntary/involuntary context switches ! 3920 MAX RESIDENT, 0 SHARED, 0 UNSHARED DATA, 0 UNSHARED STACK (Kb) Before that can work for some platforms, it looks like rusagestub.h needs to have any desired fields added, and ./src/port/getrusage.c should memset(0) in the non-windows case before adding any reliance on the rest of the structure. This comment from ~1996 says: https://doxygen.postgresql.org/postgres_8c_source.html 4421 * the only stats we don't show here are for memory usage -- i can't 4422 * figure out how to interpret the relevant fields in the rusage struct, 4423 * and they change names across o/s platforms, anyway. if you can figure 4424 * out what the entries mean, you can somehow extract resident set size, 4425 * shared text size, and unshared data and stack sizes. .. is that really (still) the case for supported platforms? I'm hoping that in 2017 one can just call getrusage() if autoconf says it's okay ?? Justin -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers