Index: Evidence/Edd/Edd.cc
===================================================================
--- Evidence/Edd/Edd.cc	(revision 221)
+++ Evidence/Edd/Edd.cc	(revision 222)
@@ -27,16 +27,18 @@
 QWidget *OpenHistory(char *Service, int Index) {
 
-  char *Name, *Format;
-  DimBrowser Browser;
-
-  // If status service displayed as text history
-  if (strstr(Service, "/Message") != NULL) return new EddText(Service);
-
-  // If service currently not available, default open as plot
-  Browser.getServices(Service);
-  if (Browser.getNextService(Name, Format) != DimSERVICE) return new EddPlot(Service, Index);
-  
-  // Otherwise, determine from format if plot or text history
-  if (strlen(Format) == 1 && *Format != 'C') return new EddPlot(Service, Index);
+  class EvidenceHistory *Hist = Handler->GetHistory(Service);
+
+  // Check if hitory service available
+  if (Hist == NULL || Hist->GetFormat() == NULL) {
+	QMessageBox::warning(NULL, "Edd Message", QString("Could not retrieve history for service ") + Service ,QMessageBox::Ok);
+	Handler->DropHistory(Service);
+	return NULL;
+  }
+
+  QString Format = Hist->GetFormat();
+  Handler->DropHistory(Service);
+  
+  //if (strlen(Hist->GetFormat()) == 1 && *Hist->GetFormat() != 'C') return new EddPlot(Service, Index);
+  if (Format.size() == 1 && Format[0] != 'C') return new EddPlot(Service, Index);
   else return new EddText(Service);
 }
@@ -66,5 +68,5 @@
 	QLineEdit(P), ServiceName(Name), Index(Index) {
 
- LastPlot = NULL;
+ LastHist = NULL;
  
   // Widget properties
@@ -135,5 +137,5 @@
   // Check if last history plot still open, then raise
   foreach (QWidget *Widget, QApplication::allWidgets()) {
-    if (Widget == LastPlot) {
+    if (Widget == LastHist) {
       Widget->activateWindow();
       Widget->raise();
@@ -177,6 +179,6 @@
 void EddLineDisplay::MenuOpenHistory() {
   
-  LastPlot = OpenHistory(ServiceName.toAscii().data(), Index);
-  if (LastPlot != NULL) LastPlot->show();
+  LastHist = OpenHistory(ServiceName.toAscii().data(), Index);
+  if (LastHist != NULL) LastHist->show();
 }
 
@@ -295,5 +297,5 @@
 		double Number=0;
 		while ((R=Hist->Next()) != NULL) {
-		  switch (Format[0].toUpper().toAscii()) {
+		  switch (*(Hist->GetFormat())) {
     		case 'I':
 			case 'L':  Number = *((int *) R->Data + List[ItemNo].Index);   break;
@@ -311,4 +313,5 @@
 		if (SizeLimit < 2*Count) SizeLimit = 2*Count;
 	  }
+	  Handler->DropHistory(List[ItemNo].Name);
 	}
 
@@ -737,4 +740,5 @@
 	  }
 	}
+	Handler->DropHistory(Name);
   }
 
@@ -876,6 +880,22 @@
 }
 
-// Update throughput statistics
+// Reduce history usage counter
+void EddDim::DropHistory(QString Name) {
+
+  for (int i=0; i<HistoryList.size(); i++) {
+	if (HistoryList[i].Name == Name) HistoryList[i].Count--;
+  }
+}
+
+// Update throughput statistics and clear up history memory
 void EddDim::UpdateStatistics() {
+
+  // Remove unused histories after not less than 5 seconds
+  for (int i=0; i<HistoryList.size(); i++) {
+	if ((HistoryList[i].Count <= 0) && (time(NULL)-HistoryList[i].LastUpdate) > 5) { 
+	  delete HistoryList[i].HistClass;
+	  HistoryList.removeAt(i);
+	}
+  }
 
   // Lock before accessing internal variables
@@ -1534,5 +1554,5 @@
   getServices("*");
   while ((Type = getNextService(Name, Format)) != 0) {
-    if (Type==DimSERVICE && strstr(Name, ".hist")==NULL) List.append(Name);
+    if (Type==DimSERVICE) List.append(Name);
   }
   List.sort();
@@ -1543,5 +1563,4 @@
   if (OK && !Result.isEmpty()) {
     Result = Result.trimmed();
-    if (Result.endsWith(".hist")) Result.chop(5);
     QWidget *Hist = OpenHistory(Result.toAscii().data(), 0);
     if (Hist != NULL) Hist->show();
Index: Evidence/Edd/Edd.h
===================================================================
--- Evidence/Edd/Edd.h	(revision 221)
+++ Evidence/Edd/Edd.h	(revision 222)
@@ -96,5 +96,5 @@
     QMenu *Menu;
     QPoint dragStart;
-    QWidget *LastPlot;
+    QWidget *LastHist;
 	
 	QString ServiceName;
@@ -247,4 +247,5 @@
 	void Unsubscribe (QString);
 	class EvidenceHistory *GetHistory(QString);
+	void DropHistory(QString);
 
   signals:
