From 4c019742c9ec3ef0634fa0a35fa2492328992cd6 Mon Sep 17 00:00:00 2001 From: hemiao11 Date: Fri, 25 Apr 2025 14:28:28 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .markdownlint.json | 25 +++++++++++++++++++ ...15\350\266\263\351\227\256\351\242\230.md" | 25 ++++++------------- 2 files changed, 33 insertions(+), 17 deletions(-) create mode 100644 .markdownlint.json diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 000000000..027d2ef53 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,25 @@ +{ + "default":true, + "MD003":{"style":"atx"}, + "MD007":{"indent":4}, + "MD029":{"style":"ordered"}, + "MD009":false, + "MD013":false, + "MD014":false, + "MD020":false, + "MD021":false, + "MD024":false, + "MD025":false, + "MD033":false, + "MD036":false, + "MD042":false, + "MD043":false, + "MD044":false, + "MD045":false, + "MD048":false, + "MD049":false, + "MD050":false, + "MD051":false, + "MD052":false, + "MD053":false +} \ No newline at end of file diff --git "a/content/zh/docs/DatabaseOMGuide/\345\206\205\345\255\230\344\270\215\350\266\263\351\227\256\351\242\230.md" "b/content/zh/docs/DatabaseOMGuide/\345\206\205\345\255\230\344\270\215\350\266\263\351\227\256\351\242\230.md" index 1d4ba9f92..054c27b35 100644 --- "a/content/zh/docs/DatabaseOMGuide/\345\206\205\345\255\230\344\270\215\350\266\263\351\227\256\351\242\230.md" +++ "b/content/zh/docs/DatabaseOMGuide/\345\206\205\345\255\230\344\270\215\350\266\263\351\227\256\351\242\230.md" @@ -18,15 +18,13 @@ 2、端口+1登录成功后查询总的内存使用视图: - ``` + ```bash select * from gs_total_memory_detail; ``` - -![](figures/123.jpg) - +![](figures/234.png) max_process_memory:guc参数设置 @@ -46,27 +44,23 @@ max_cstore_memory:cstore_buffers other_used_memory:process_used_memory – dynamic_used_memory –shared_used_memory – cstore_used_memory - 3、根据第2步中查出的内存使用情况进行如下分析: -- 若dynamic_used_shrctx数据异常大,查询如下视图:gs_shared_memory_detail - +- 若dynamic_used_shrctx数据异常大,查询如下视图:gs_shared_memory_detail - ``` + ```bash select contextname, sum(totalsize)/1024/1024 sum, sum(freesize)/1024/1024, count(*) count from gs_shared_memory_detail group by contextname order by sum desc limit 10; ``` -根据查出的内存context信息,使用内存最大的context可能存在内存泄漏。 - - -![](figures/234.png) +根据查出的内存context信息,使用内存最大的context可能存在内存泄漏。 -- 若dynamic_used_memory数值较大,dynamic_used_shrctx数值很小,则查询如下视图:gs_session_memory_detail +![](figures/123.jpg) +- 若dynamic_used_memory数值较大,dynamic_used_shrctx数值很小,则查询如下视图:gs_session_memory_detail - ``` + ```bash select contextname, sum(totalsize)/1024/1024 sum, sum(freesize)/1024/1024, count(*) count from gs_session_memory_detail group by contextname order by sum desc limit 10; ``` @@ -79,11 +73,8 @@ select contextname, sum(totalsize)/1024/1024 sum, sum(freesize)/1024/1024, count SessionCacheMemoryContext,StorageTopMemoryContext - - 4、根据第3步中确认的可能存在内存泄漏的context,通过如下视图可直接查询该context上内存申请的详细信息; - gs_get_shared_memctx_detail(text) 描述:返回指定内存上下文上的内存申请的详细信息,包含每一处内存申请所在的文件、行号和大小(同一文件同一行大小会做累加)。只支持查询通过pg_shared_memory_detail视图查询出来的内存上下文,入参为内存上下文名称(即pg_shared_memory_detail返回结果的contextname列)。查询该函数必须具有sysadmin权限或者monitor admin权限。查询结果为如下三列:
-- Gitee From cf2c82f8632f0c29b1c5fadbd1f72c036308b883 Mon Sep 17 00:00:00 2001 From: hemiao11 Date: Fri, 25 Apr 2025 14:47:47 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8D=A2=E8=A1=8C?= =?UTF-8?q?=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\255\230\344\270\215\350\266\263\351\227\256\351\242\230.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/content/zh/docs/DatabaseOMGuide/\345\206\205\345\255\230\344\270\215\350\266\263\351\227\256\351\242\230.md" "b/content/zh/docs/DatabaseOMGuide/\345\206\205\345\255\230\344\270\215\350\266\263\351\227\256\351\242\230.md" index 054c27b35..083ab71c6 100644 --- "a/content/zh/docs/DatabaseOMGuide/\345\206\205\345\255\230\344\270\215\350\266\263\351\227\256\351\242\230.md" +++ "b/content/zh/docs/DatabaseOMGuide/\345\206\205\345\255\230\344\270\215\350\266\263\351\227\256\351\242\230.md" @@ -221,4 +221,4 @@ export MALLOC_CONF=prof:true,prof_final:false,prof_gdump:true,lg_prof_sample:20 ![](figures/4a83e2756be740d18f88_211x92.jpg) -可以看出该函数总共申请的内存大小,占系统总共申请内存大小的百分比等信息。 \ No newline at end of file +可以看出该函数总共申请的内存大小,占系统总共申请内存大小的百分比等信息。 -- Gitee From 3c56b85e8b3475a565a2bf1d1a5b0c37839e918e Mon Sep 17 00:00:00 2001 From: hemiao11 Date: Fri, 25 Apr 2025 14:51:28 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .markdownlint.json | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 .markdownlint.json diff --git a/.markdownlint.json b/.markdownlint.json deleted file mode 100644 index 027d2ef53..000000000 --- a/.markdownlint.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "default":true, - "MD003":{"style":"atx"}, - "MD007":{"indent":4}, - "MD029":{"style":"ordered"}, - "MD009":false, - "MD013":false, - "MD014":false, - "MD020":false, - "MD021":false, - "MD024":false, - "MD025":false, - "MD033":false, - "MD036":false, - "MD042":false, - "MD043":false, - "MD044":false, - "MD045":false, - "MD048":false, - "MD049":false, - "MD050":false, - "MD051":false, - "MD052":false, - "MD053":false -} \ No newline at end of file -- Gitee