Index: trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 6870)
+++ trunk/MagicSoft/Mars/mbase/MEvtLoop.cc	(revision 6890)
@@ -263,4 +263,18 @@
 
     return kTRUE;
+}
+
+// --------------------------------------------------------------------------
+//
+// Return the memory currently used by this process (VmSize)
+// which contains shared memory, data memory and private memory.
+//
+UInt_t MEvtLoop::GetMemoryUsage()
+{
+    const TString path = Form("/proc/%d/status", gSystem->GetPid());
+    if (gSystem->AccessPathName(path, kFileExists))
+        return 0;
+
+    return TEnv(path).GetValue("VmSize", 0);
 }
 
@@ -400,4 +414,6 @@
         return kFALSE;
 
+    const UInt_t mem0 = GetMemoryUsage();
+
     //
     //   loop over all events and process all tasks for
@@ -514,4 +530,9 @@
     if (numcnts>0)
         *fLog << " --> " << numcnts/clock.RealTime() << " Events/s";
+
+
+    const UInt_t mem1 = GetMemoryUsage();
+    if (mem1>mem0)
+        *fLog << endl << "Mem  - Loss: " << mem1-mem0 << "kB" << endl;
 
     *fLog << endl << endl;
Index: trunk/MagicSoft/Mars/mbase/MEvtLoop.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MEvtLoop.h	(revision 6870)
+++ trunk/MagicSoft/Mars/mbase/MEvtLoop.h	(revision 6890)
@@ -40,4 +40,5 @@
 
     Bool_t ProcessGuiEvents(Int_t num);
+    static UInt_t GetMemoryUsage();
 
 public:
Index: trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 6870)
+++ trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc	(revision 6890)
@@ -64,4 +64,5 @@
 
 #include <TH1.h>                  // TH1::AddDirectory
+#include <TEnv.h>                 // TEnv
 #include <TLine.h>                // TLine
 #include <TText.h>                // TText
@@ -239,8 +240,12 @@
     MGPopupMenu *sizemenu = new MGPopupMenu(gClient->GetRoot());
     sizemenu->AddEntry("Fit to 640x&480",   kSize640);
+    sizemenu->AddEntry("Fit to 768x&576",   kSize768);
     sizemenu->AddEntry("Fit to 800x&600",   kSize800);
     sizemenu->AddEntry("Fit to 960x7&20",   kSize960);
     sizemenu->AddEntry("Fit to 1024x&768",  kSize1024);
+    sizemenu->AddEntry("Fit to 1152x&864",  kSize1152);
     sizemenu->AddEntry("Fit to 1280x&1024", kSize1280);
+    sizemenu->AddEntry("Fit to 1400x1050",  kSize1400);
+    sizemenu->AddEntry("Fit to 1600x1200",  kSize1600);
     sizemenu->Associate(this);
 
@@ -524,7 +529,7 @@
     //       a = (-1+-sqrt(1+4))/2 = sqrt(5)/2-1/2 = 0.618
     //
-    Int_t p[2] = {38, 62};
-
-    fStatusBar->SetParts(p, 2);
+    Int_t p[] = {38-2, 62-8, 10};
+
+    fStatusBar->SetParts(p, 3);
 
     TGLayoutHints *layb = new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 5, 4, 0, 3);
@@ -539,9 +544,9 @@
 // Change the text in the status line 1
 //
-void MStatusDisplay::SetStatusLine1(const char *txt)
+void MStatusDisplay::SetStatusLine(const char *txt, Int_t i)
 {
     if (gROOT->IsBatch())
         return;
-    fStatusBar->SetText(txt, 0);
+    fStatusBar->SetText(txt, i);
 
     // FIXME: This is a workaround, because TApplication::Run is not
@@ -555,23 +560,4 @@
 // --------------------------------------------------------------------------
 //
-// Change the text in the status line 2
-//
-void MStatusDisplay::SetStatusLine2(const char *txt)
-{
-    if (gROOT->IsBatch())
-        return;
-
-    fStatusBar->SetText(txt, 1);
-
-    // FIXME: This is a workaround, because TApplication::Run is not
-    //        thread safe against ProcessEvents. We assume, that if
-    //        we are not in the Main-Thread ProcessEvents() is
-    //        called by the TApplication Event Loop...
-    if (!TThread::Self()/*gApplication->InheritsFrom(TRint::Class())*/)
-        gClient->ProcessEventsFor(fStatusBar);
-}
-
-// --------------------------------------------------------------------------
-//
 // Display information about the name of a container
 //
@@ -643,5 +629,5 @@
     // set the smallest and biggest size of the Main frame
     // and move it to its appearance position
-    SetWMSizeHints(570, 480, 1280, 980, 1, 1);
+    SetWMSizeHints(570, 480, 2048, 1536, 1, 1);
     MoveResize(rand()%100+570, rand()%100+480, 570, 480);
 
@@ -1264,18 +1250,29 @@
         return kTRUE;
 
-    case kSize640:
+    case kSize640:  
         Resize(570, 480);
         return kTRUE;
-    case kSize800:
+    case kSize768:  
+        Resize(700, 576);
+        return kTRUE;
+    case kSize800:  
         Resize(740, 600);
         return kTRUE;
-    case kSize960:
+    case kSize960:  
         Resize(880, 700);
         return kTRUE;
-    case kSize1024:
+    case kSize1024: 
         Resize(980, 768);
         return kTRUE;
-    case kSize1280:
+    case kSize1152:
+        Resize(1080, 864);
+    case kSize1280: 
         Resize(1280, 980);
+        return kTRUE;
+    case kSize1400:
+        Resize(1350, 1050);
+        return kTRUE;
+    case kSize1600:
+        Resize(1550, 1400);
         return kTRUE;
 
@@ -1527,5 +1524,6 @@
 void MStatusDisplay::CloseWindow()
 {
-    Close();
+    if (Close())
+        delete this;
 }
 
@@ -1552,4 +1550,36 @@
 // --------------------------------------------------------------------------
 //
+// Update the memory display in the status bar
+//
+void MStatusDisplay::UpdateMemory() const
+{
+    const TString path = MString::Form("/proc/%d/status", gSystem->GetPid());
+    if (gSystem->AccessPathName(path, kFileExists))
+        return;
+
+    TEnv env(path);
+    const UInt_t kb = env.GetValue("VmSize", 0);
+    if (kb==0)
+        return;
+
+    char type = 'k';
+    Float_t val = kb;
+
+    if (val>999)
+    {
+        type = 'M';
+        val /= 1024;
+    }
+    if (val>999)
+    {
+        type = 'G';
+        val /= 1024;
+    }
+    const TString txt = MString::Form("%.1f%c", val, type);
+    fStatusBar->SetText(txt, 2);
+}
+
+// --------------------------------------------------------------------------
+//
 // Updates the canvas (if existing) in the currenly displayed Tab.
 // The update intervall is controlled by StartUpdate and StopUpdate
@@ -1559,4 +1589,6 @@
     if (gROOT->IsBatch())
         return kTRUE;
+
+    UpdateMemory();
 
     const Int_t c = fTab->GetCurrent();
@@ -2480,5 +2512,5 @@
     {
         if (Close())
-        delete this;
+            delete this;
 //        Close();
         return kTRUE;
Index: trunk/MagicSoft/Mars/mbase/MStatusDisplay.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MStatusDisplay.h	(revision 6870)
+++ trunk/MagicSoft/Mars/mbase/MStatusDisplay.h	(revision 6890)
@@ -46,5 +46,6 @@
         kTabSaveAsC, kTabPrint, kTabNext, kTabPrevious, kTabRemove,
         // kSize
-        kSize640, kSize800, kSize960, kSize1024, kSize1280,
+        kSize640, kSize768, kSize800, kSize960, kSize1024, kSize1152,
+        kSize1280, kSize1400, kSize1600,
         // kLog
         kLogCopy, kLogClear, kLogSelect, kLogFind, kLogSave, kLogAppend,
@@ -117,4 +118,5 @@
     Bool_t HandleTimer(TTimer *timer=NULL);
     void UpdateTab(TGCompositeFrame *f);
+    void UpdateMemory() const;
 
     void DrawClonePad(TCanvas &newc, TCanvas &oldc) const;
@@ -127,4 +129,5 @@
 
     void RemoveTab(int i);
+    void SetStatusLine(const char *txt, Int_t idx);
 
     TRootEmbeddedCanvas *GetEmbeddedCanvas(TGCompositeFrame *cf) const;
@@ -143,6 +146,6 @@
      TGProgressBar *GetBar() const { return (TGProgressBar*)fBar; }
 
-     void SetStatusLine1(const char *txt);
-     void SetStatusLine2(const char *txt);
+     void SetStatusLine1(const char *txt) { SetStatusLine(txt, 0); }
+     void SetStatusLine2(const char *txt) { SetStatusLine(txt, 1); }
      void SetStatusLine2(const MParContainer &cont);
 
