Memory Context Info dump

Поиск
Список
Период
Сортировка
От Rajeev rastogi
Тема Memory Context Info dump
Дата
Msg-id BF2827DCCE55594C8D7A8F7FFD3AB77159939C05@szxeml521-mbs.china.huawei.com
обсуждение исходный текст
Ответы Re: Memory Context Info dump  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

In our customer environment as well as during development, we have observed that many time we need to get details of memory used by each contexts in order to analyze the memory consumption/leak.

So I would like to propose one contrib function interface, which will dump the whole memory context into a file.

 

One of the major infrastructure i.e. the function MemoryContextStats (which dump all memory context details on the console) is already there in PG but it is being automatically called for scenarios

such as “system is out of memory”.

 

So Now:

1.       Create one contrib function dump_memctxt_info, which is when executed, it will call the existing function MemoryContextStats.

2.       The file to dump will be created in the following format:

context_<process id>_<timestamp>.dump

3.       The file handler will be passed to MemoryContextStats.

4.       If the parameter to MemoryContextStats is NULL (All existing calls will pass NULL), then it will behave as earlier i.e. dump on console.

5.       The output format of the context will be same as earlier.

6.       One sample file is attached.

 

Use-case:

In order to check the memory leak, this contrib function can be called before and after execution of query. Then comparison of these two dump will be helpful to further analyze.

 

Attached is the patch. Please provide your opinion. If it is OK, I will add it to next commitFest.

 

Thanks and Regards,

Kumar Rajeev Rastogi

 

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Kevin Grittner
Дата:
Сообщение: Re: Small patch to fix an O(N^2) problem in foreign keys
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: proposal: function parse_ident