List:Commits« Previous MessageNext Message »
From:Christopher Powers Date:February 3 2009 7:23am
Subject:bzr commit into mysql-6.0-falcon-team branch (christopher.powers:2998)
Bug#32838
View as plain text  
#At file:///home/cpowers/work/dev/dev-04/mysql/

 2998 Christopher Powers	2009-02-03
      Bug #32838 "Falcon; error 1296 : Got error 305 'record memory is exhausted'"
      
      Several factors contribute to the out of memory error. Many have been resolved
      in other bugs (see Bug#42424, Bug#42505, Bug#42510 for details).
      
      Record scavenger efficiency can be further improved by reducing record
      cache fragmentation.
      
      The size of Record and RecordVersion objects is always the same, but the
      size of record data can vary considerably. The record cache becomes more
      fragmented over time because it is interspersed with fixed-size Record and
      RecordVersion objects.
      
      Record and RecordVersion objects are now allocated from a memory pool
      separate from the record data. Both memory pools will be more homogeneous,
      less fragmented and easier to scavenge.
modified:
  storage/falcon/Database.cpp
  storage/falcon/Database.h
  storage/falcon/MemMgr.cpp
  storage/falcon/Table.cpp

per-file messages:
  storage/falcon/Database.cpp
    Added recordObjectPool
  storage/falcon/Database.h
    Added recordObjectPool
  storage/falcon/MemMgr.cpp
    Added record object memory manager
  storage/falcon/Table.cpp
    Table::allocRecord and allocRecordVersion methods now allocate
    objects from the record object pool. Record data is still
    allocated from the record data memory pool (record cache).
=== modified file 'storage/falcon/Database.cpp'
--- a/storage/falcon/Database.cpp	2009-02-03 02:53:42 +0000
+++ b/storage/falcon/Database.cpp	2009-02-03 07:23:08 +0000
@@ -485,7 +485,7 @@ Database::Database(const char *dbName, C
 	serialLogBlockSize = configuration->serialLogBlockSize;
 	longSync = false;
 	recordDataPool = MemMgrGetFixedPool(MemMgrPoolRecordData);
-	//recordObjectPool = MemMgrGetFixedPool(MemMgrPoolRecordObject);
+	recordObjectPool = MemMgrGetFixedPool(MemMgrPoolRecordObject);
 	syncObject.setName("Database::syncObject");
 	syncTables.setName("Database::syncTables");
 	syncStatements.setName("Database::syncStatements");

=== modified file 'storage/falcon/Database.h'
--- a/storage/falcon/Database.h	2009-02-03 02:53:42 +0000
+++ b/storage/falcon/Database.h	2009-02-03 07:23:08 +0000
@@ -326,6 +326,7 @@ public:
 	volatile INTERLOCK_TYPE	scavengeForced;
 	PageWriter			*pageWriter;
 	PreparedStatement	*updateCardinality;
+	MemMgr				*recordObjectPool;
 	MemMgr				*recordDataPool;
 	time_t				startTime;
 	

=== modified file 'storage/falcon/MemMgr.cpp'
--- a/storage/falcon/MemMgr.cpp	2009-01-08 09:05:26 +0000
+++ b/storage/falcon/MemMgr.cpp	2009-02-03 07:23:08 +0000
@@ -35,6 +35,7 @@
 #include "Stream.h"
 #include "InfoTable.h"
 #include "MemControl.h"
+#include "RecordVersion.h"
 
 #ifdef HAVE_purify
 #ifdef HAVE_CONFIG
@@ -81,7 +82,7 @@ bool memoryManagerAlive;
 
 static MemMgr		memoryManager(defaultRounding, FREE_OBJECTS_SIZE, HEAP_SIZE,&memoryManagerAlive);
 static MemMgr		recordManager(defaultRounding, 2, HEAP_SIZE);
-//static MemMgr		recordObjectManager (defaultRounding, sizeof(RecordVersion) + 100, HEAP_SIZE);
+static MemMgr		recordObjectManager (defaultRounding, sizeof(RecordVersion) + 100, HEAP_SIZE);
 static MemControl	memControl;
 
 #ifdef _DEBUG
@@ -206,7 +207,7 @@ void MemMgrValidate ()
 {
 	memoryManager.validate();
 	recordManager.validate();
-	//recordObjectManager.validate();
+	recordObjectManager.validate();
 }
 
 void MemMgrValidate (void *object)
@@ -239,12 +240,12 @@ void MemMgrAnalyze(MemMgrWhat what, Info
 
 		case MemMgrRecordSummary:
 			recordManager.analyze(0, NULL, infoTable, NULL);
-			//recordObjectManager.analyze(0, NULL, infoTable, NULL);
+			recordObjectManager.analyze(0, NULL, infoTable, NULL);
 			break;
 
 		case MemMgrRecordDetail:
 			recordManager.analyze(0, NULL, NULL, infoTable);
-			//recordObjectManager.analyze(0, NULL, NULL, infoTable);
+			recordObjectManager.analyze(0, NULL, NULL, infoTable);
 			break;
 		}
 }
@@ -254,7 +255,11 @@ void MemMgrSetMaxRecordMember (long long
 	if (!recordManager.memControl)
 		{
 		memControl.addPool(&recordManager);
-		//memControl.addPool(&recordObjectManager);
+		
+		// Don't combine record data and record object memory
+		// in max size checks
+		
+		//	memControl.addPool(&recordObjectManager);
 		}
 	memControl.setMaxSize(size);
 }
@@ -269,10 +274,8 @@ MemMgr*	MemMgrGetFixedPool (int id)
 		case MemMgrPoolRecordData:
 			return &recordManager;
 
-		/***
 		case MemMgrPoolRecordObject:
 			return &recordObjectManager;
-		***/
 
 		default:
 			return NULL;

=== modified file 'storage/falcon/Table.cpp'
--- a/storage/falcon/Table.cpp	2009-02-01 09:00:52 +0000
+++ b/storage/falcon/Table.cpp	2009-02-03 07:23:08 +0000
@@ -3641,7 +3641,7 @@ RecordVersion* Table::allocRecordVersion
 			if ((++database->recordPoolAllocCount & 0x7F) == 0)
 				database->checkRecordScavenge();
 
-			return POOL_NEW(database->recordDataPool) RecordVersion(this, format, transaction, priorVersion);
+			return POOL_NEW(database->recordObjectPool) RecordVersion(this, format, transaction, priorVersion);
 			}
 
 		catch (SQLException& exception)
@@ -3678,7 +3678,7 @@ Record* Table::allocRecord(int recordNum
 			if ((++database->recordPoolAllocCount & 0x7F) == 0)
 				database->checkRecordScavenge();
 
-			return POOL_NEW(database->recordDataPool) Record (this, recordNumber, stream);
+			return POOL_NEW(database->recordObjectPool) Record (this, recordNumber, stream);
 			}
 
 		catch (SQLException& exception)

Thread
bzr commit into mysql-6.0-falcon-team branch (christopher.powers:2998)Bug#32838Christopher Powers3 Feb