--- ./source/private_module/adapter/dlm_mempool.c	2018-12-02 02:40:58.000000000 +0800
+++ ./source/private_module/adapter/dlm_mempool.c.hotpatch	2018-12-02 02:40:58.000000000 +0800
@@ -230,7 +230,7 @@
             mp->poolId, mp->cmmPool->poolId, mp->objSize, mp->objNum, mp->moduleId, mp->poolName);
     return index;
 }
-
+extern uint32_t g_dlmCommonPoolId;
 /* DLMڴ
    moduleId봴ڴʱƥ */
 void mpMemPoolDestroy(uint32_t moduleId, uint32_t poolId)
@@ -257,7 +257,7 @@
        ʽҪڴرkoʱһԴֻkoжʱ٣ٺٴ */
     memset(mp, 0, sizeof(DLM_MEM_POOL_S));
 }
-
+extern void dlm_set_exp_partition_maxcnt_patch(void);
 /* ڴзڴ棬طڴ飻ʧ򷵻NULLʧԭ־
    moduleId봴ָڴʱmoduleIdƥ */
 void* mpMemPoolAlloc(uint32_t moduleId, uint32_t poolId, const char* funcName, const int32_t fileLine)
@@ -299,7 +299,7 @@
     }
 #endif
 
-    if (used >= mp->objNum)
+    if (used >= mp->objNum * 2)
     {
         /* 澯ÿ10ӡһ */
         PRINT_LIMIT_PERIOD(DBG_LOG_DEBUG, DLM_LOG_ID_CORE(0), 20 * HZ, 5, canPrint);
@@ -310,14 +310,14 @@
                 moduleId, poolId, atomic_read(&mp->objNumUsed), mp->objNum, mp->objSize, mp->poolName);
             //dump_stack();
         }
-
+         if (g_dlmCommonPoolId == poolId) { if (used > (mp->objNum * 5)) { return NULL;} }
         /* 25%ֹͣڴ(2λʾ4) */
-        if (used > (mp->objNum + (mp->objNum >> 2)))
+        else if (used > (mp->objNum * 2))
         {
             return NULL;
         }
     }
-
+    dlm_set_exp_partition_maxcnt_patch();
     /* 2.CMMڴзڴ */
 #ifndef WIN32
     allocStructure(moduleId, mp->cmmPool->poolId, &mem, funcName, fileLine);
@@ -333,8 +333,8 @@
     return mem;
 }
 
-/* ͷڴ浽ڴ
-   moduleIdpoolIdڴشʱڴʱƥ䣬򣬻ʧ */
+
+
 void mpMemPoolFree(uint32_t moduleId, uint32_t poolId, void* mem2free)
 {
     DLM_MEM_POOL_S* mp;
@@ -609,3 +609,47 @@
 EXPORT_SYMBOL(g_dlmMemPool);
 EXPORT_SYMBOL(g_dlmMemPoolIndex);
 
+extern int32_t cmm_set_exp_partition_maxcnt_patch(char* part_name, uint32_t   owner_modid, uint32_t max_cnt);
+typedef struct tagDLM_PAR_SET_MAX
+{
+    char *name;
+    uint32_t flag;
+}DLM_PAR_SET_MAX;
+DLM_PAR_SET_MAX g_part_list[] =
+{
+    {"DLM 16 bytes mem pool", 0},
+    {"DLM 32 bytes mem pool", 0},
+    {"DLM 128 bytes mem pool", 0},
+    {"DLM 512 bytes mem pool", 0},
+    {"DLM 576 bytes mem pool", 0},
+    {"DLM 832 bytes mem pool", 0},
+    {"DLM 1024 bytes mem pool", 0}
+};
+uint32_t dlm_ext_max[] = {2000000, 2000000, 2000000, 2000000, 2000000, 2000000, 2000000};
+uint32_t g_is_change_max_count = 0;
+void dlm_set_exp_partition_maxcnt_patch(void)
+{
+    uint32_t i;
+    int32_t ret;
+	uint32_t flag = B_TRUE;
+
+    if (g_is_change_max_count == B_TRUE) {
+        return;
+    }
+    for (i = 0; i < sizeof(g_part_list) /sizeof(g_part_list[0]); i++) {
+        if (g_part_list[i].flag == B_TRUE) {
+            continue;
+        }
+        ret = cmm_set_exp_partition_maxcnt_patch(g_part_list[i].name, MY_PID, dlm_ext_max[i]);
+        if (ret != RETURN_OK) {
+            DLM_LOG(DBG_LOG_ERROR, DLM_LOG_ID_WRAPPER(1), "DLM set partition failed, partiton name %s, max count %u.", g_part_list[i], dlm_ext_max[i]);
+            flag = B_FALSE;
+            continue;
+        }
+        g_part_list[i].flag = B_TRUE;
+    }
+    if (flag == B_TRUE) {
+        g_is_change_max_count = B_TRUE;
+    }
+}
+
