Commit 44310b14 authored by jonas@perch.ndb.mysql.com's avatar jonas@perch.ndb.mysql.com

Merge perch.ndb.mysql.com:/home/jonas/src/50-work

into  perch.ndb.mysql.com:/home/jonas/src/51-work
parents a5408787 0d534b57
......@@ -683,7 +683,7 @@ void getTextMemoryUsage(QQQQ) {
const int used = theData[3];
const int total = theData[4];
const int block = theData[5];
const int percent = (used*100)/total;
const int percent = total ? (used*100)/total : 0;
BaseString::snprintf(m_text, m_text_len,
"%s usage %s %d%s(%d %dK pages of total %d)",
......
......@@ -42,6 +42,7 @@ void Dbacc::initData()
scanRec = 0;
tabrec = 0;
cnoOfAllocatedPages = cpagesize = 0;
// Records with constant sizes
}//Dbacc::initData()
......
......@@ -113,7 +113,7 @@ void Dbacc::execCONTINUEB(Signal* signal)
case ZREPORT_MEMORY_USAGE:{
jam();
static int c_currentMemUsed = 0;
int now = (cnoOfAllocatedPages * 100)/cpagesize;
int now = cpagesize ? (cnoOfAllocatedPages * 100)/cpagesize : 0;
const int thresholds[] = { 99, 90, 80, 0};
Uint32 i = 0;
......
......@@ -169,7 +169,8 @@ void Dbtup::execCONTINUEB(Signal* signal)
case ZREPORT_MEMORY_USAGE:{
ljam();
static int c_currentMemUsed = 0;
int now = (cnoOfAllocatedPages * 100)/c_page_pool.getSize();
Uint32 sz = c_page_pool.getSize();
int now = sz ? (cnoOfAllocatedPages * 100)/sz : 0;
const int thresholds[] = { 100, 90, 80, 0 };
Uint32 i = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment