Index: /GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp	(revision 1649)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp	(revision 1653)
@@ -2529,5 +2529,5 @@
 	RegisterOption("Hierarchy.Termination.maxMemory",
 					optFloat,
-					"hierarchy_construction_max_memory=",
+					"hierarchy_term_max_memory=",
 					"1");
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp	(revision 1633)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp	(revision 1653)
@@ -1501,20 +1501,22 @@
 								const int totalPvs,
 								const int entriesInPvs,
+								const float memoryCost,
 								const int pvsSizeDecr,
 								const float volume)
 {
 	 stats << "#Pass\n" << pass << endl
-		<< "#ViewCells\n" << viewCells << endl 
-        << "#RenderCostDecrease\n" << renderCostDecrease << endl // TODO
-		<< "#TotalRenderCost\n" << totalRenderCost << endl
-		<< "#CurrentPvs\n" << currentPvs << endl
-		<< "#ExpectedCost\n" << expectedCost << endl
-		<< "#AvgRenderCost\n" << avgRenderCost << endl
-		<< "#Deviation\n" << deviation << endl
-		<< "#TotalPvs\n" << totalPvs << endl
-		<< "#TotalEntriesInPvs\n" << entriesInPvs << endl
-		<< "#PvsSizeDecrease\n" << pvsSizeDecr << endl // TODO
-		<< "#Volume\n" << volume << endl
-		<< endl;
+		   << "#ViewCells\n" << viewCells << endl 
+		   << "#RenderCostDecrease\n" << renderCostDecrease << endl // TODO
+		   << "#TotalRenderCost\n" << totalRenderCost << endl
+		   << "#CurrentPvs\n" << currentPvs << endl
+		   << "#ExpectedCost\n" << expectedCost << endl
+		   << "#AvgRenderCost\n" << avgRenderCost << endl
+		   << "#Deviation\n" << deviation << endl
+		   << "#TotalPvs\n" << totalPvs << endl
+		   << "#TotalEntriesInPvs\n" << entriesInPvs << endl
+		   << "#Memory\n" << memoryCost << endl
+		   << "#PvsSizeDecrease\n" << pvsSizeDecr << endl
+		   << "#Volume\n" << volume << endl
+		   << endl;
 }
 
@@ -1546,11 +1548,24 @@
 	stats.open(mergeStats.c_str());
 
+	const float entrySize = sizeof(PvsData) + sizeof(Intersectable *);
+	const float memoryCost = (float)entriesInPvs *  entrySize / (1024.0f * 1024.0f);
+
 	/////////////
 	//-- first view cell
 
 	UpdateStats(stats,
-				0, numViewCells, 0, totalRenderCost, 
-				rootPvs, expectedCost, avgRenderCost, deviation,
-				totalPvs, entriesInPvs, 0, mRoot->GetVolume());
+				0, 
+				numViewCells, 
+				0, 
+				totalRenderCost, 
+				rootPvs, 
+				expectedCost, 
+				avgRenderCost, 
+				deviation,
+				totalPvs, 
+				entriesInPvs,
+				memoryCost,
+				0, 
+				mRoot->GetVolume());
 		
 
@@ -1606,10 +1621,21 @@
 			avgRenderCost = (float)totalPvs / (float)numViewCells;
 
+			const float entrySize = sizeof(PvsData) + sizeof(Intersectable *);
+			const float memoryCost = (float)entriesInPvs * entrySize / (1024.0f * 1024.0f);
+
 			UpdateStats(stats,
-						0, numViewCells, costDecr, totalRenderCost,
-						parentPvs, expectedCost, avgRenderCost, deviation,
-                        totalPvs, entriesInPvs, childPvs - parentPvs,
+						0, 
+						numViewCells, 
+						costDecr, 
+						totalRenderCost,
+						parentPvs, 
+						expectedCost, 
+						avgRenderCost, 
+						deviation,
+                        totalPvs, 
+						entriesInPvs, 
+						memoryCost,
+						childPvs - parentPvs,
 						vc->GetVolume());
-
 		}
 	}
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h	(revision 1603)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h	(revision 1653)
@@ -629,18 +629,18 @@
 	/** Update stats for the log.
 	*/
-	void UpdateStats(
-		ofstream &stats,
-		const int pass,
-		const int viewCells,
-		const float renderCostDecrease,
-		const float totalRenderCost,
-		const int currentPvs,
-		const float expectedCost,
-		const float avgRenderCost,
-		const float deviation,
-		const int totalPvs,
-		const int entriesInPvs,
-		const int pvsSizeDecr,
-		const float volume);
+	void UpdateStats(ofstream &stats,
+					 const int pass,
+					 const int viewCells,
+					 const float renderCostDecrease,
+					 const float totalRenderCost,
+					 const int currentPvs,
+					 const float expectedCost,
+					 const float avgRenderCost,
+					 const float deviation,
+					 const int totalPvs,
+					 const int entriesInPvs,
+					 const float memoryCost,
+					 const int pvsSizeDecr,
+					 const float volume);
 
 
Index: /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp
===================================================================
--- /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 1649)
+++ /GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp	(revision 1653)
@@ -122,4 +122,6 @@
 		"Hierarchy.Termination.maxMemory", mTermMaxMemory);
 
+	mTermMaxMemory *= (1024.0f * 1024.0f);
+
 	Debug << "******** Hierachy Manager Options ***********" << endl;
 	Debug << "max leaves: " << mTermMaxLeaves << endl;
@@ -283,5 +285,5 @@
 		);
 
-//#if _DEBUG
+#if _DEBUG
 	if (terminationCriteriaMet)
 	{
@@ -291,5 +293,5 @@
 		Debug << "memory: " << mHierarchyStats.mMemory << " " << mTermMaxMemory << endl;
 	}
-//#endif
+#endif
 
 	return terminationCriteriaMet;
