fix alloc co_stack failed, and add resident_size for CHUNK_MGR

This commit is contained in:
obdev 2023-04-20 11:41:54 +00:00 committed by ob-robot
parent 2657770e7f
commit 0e0ebed267
3 changed files with 6 additions and 16 deletions

View File

@ -21,8 +21,8 @@ namespace oceanbase
{
namespace common
{
static constexpr int64_t ALL_STACK_LIMIT = 10L << 20;
static constexpr int64_t STACK_PER_EXTEND = (2L << 20) - ACHUNK_PRESERVE_SIZE;
static constexpr int64_t ALL_STACK_LIMIT = 12L << 20;
static constexpr int64_t STACK_PER_EXTEND = (4L << 20) - ACHUNK_PRESERVE_SIZE;
static constexpr int64_t STACK_RESERVED_SIZE = 128L << 10;
RLOCAL_EXTERN(int64_t, all_stack_size);

View File

@ -20,18 +20,6 @@
#include "observer/ob_server_struct.h" // GCTX
#include "share/ob_tenant_mgr.h"
int64_t get_virtual_memory_used()
{
constexpr int BUFFER_SIZE = 128;
char filename[BUFFER_SIZE];
int64_t page_cnt = 0;
snprintf(filename, BUFFER_SIZE, "/proc/%d/statm", getpid());
FILE *statm = fopen(filename, "r");
fscanf(statm, "%ld", &page_cnt);
fclose(statm);
return page_cnt * sysconf(_SC_PAGESIZE);
}
namespace oceanbase
{
namespace lib

View File

@ -123,11 +123,12 @@ int ObTenantMemoryPrinter::print_tenant_usage()
}
// print global chunk freelist
int64_t memory_used = get_virtual_memory_used();
int64_t resident_size = 0;
int64_t memory_used = get_virtual_memory_used(&resident_size);
_STORAGE_LOG(INFO,
"[CHUNK_MGR] free=%ld pushes=%ld pops=%ld limit=%'15ld hold=%'15ld total_hold=%'15ld used=%'15ld" \
" freelist_hold=%'15ld maps=%'15ld unmaps=%'15ld large_maps=%'15ld large_unmaps=%'15ld" \
" memalign=%d"
" memalign=%d resident_size=%'15ld"
#ifndef ENABLE_SANITY
" virtual_memory_used=%'15ld\n",
#else
@ -146,6 +147,7 @@ int ObTenantMemoryPrinter::print_tenant_usage()
CHUNK_MGR.get_large_maps(),
CHUNK_MGR.get_large_unmaps(),
0,
resident_size,
#ifndef ENABLE_SANITY
memory_used
#else