Index: trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.cpp	(revision 102744)
+++ trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.cpp	(revision 102746)
@@ -51,9 +51,13 @@
 /* COM includes: */
 #include "CConsole.h"
+#include "CForm.h"
+#include "CFormValue.h"
 #include "CGuest.h"
 #include "CPerformanceCollector.h"
 #include "CPerformanceMetric.h"
 #include "CStringArray.h"
+#include "CRangedIntegerFormValue.h"
 #include <iprt/string.h>
+#include <VBox/com/VirtualBox.h>
 
 /* External includes: */
@@ -725,5 +729,5 @@
         return QString::number(iValue).append("%");
     if (m_pMetric->unit().compare("kb", Qt::CaseInsensitive) == 0)
-        return UITranslator::formatSize(_1K * (quint64)iValue, g_iDecimalCount);
+        return UITranslator::formatSize(_1K * iValue, g_iDecimalCount);
     if (   m_pMetric->unit().compare("b", Qt::CaseInsensitive) == 0
         || m_pMetric->unit().compare("b/s", Qt::CaseInsensitive) == 0)
@@ -731,4 +735,6 @@
     if (m_pMetric->unit().compare("times", Qt::CaseInsensitive) == 0)
         return UITranslator::addMetricSuffixToNumber(iValue);
+    if (m_pMetric->unit().compare("gb", Qt::CaseInsensitive) == 0)
+        return QString::number(iValue).append(" GB");
     return QString();
 }
@@ -1044,5 +1050,4 @@
 
     addData(iDataSeriesIndex, iData);
-
     if (iDataSeriesIndex == 0)
     {
@@ -1931,9 +1936,11 @@
     m_metricTypeNames[KMetricType_NetworksBytesOut] = m_strNetworkMetricName;
 
+    setMachine(machine);
+    determineTotalRAMAmount();
+
     prepareMetrics();
     prepareWidgets();
     retranslateUi();
     prepareActions();
-    setMachine(machine);
     resetCPUInfoLabel();
     resetNetworkInfoLabel();
@@ -1941,4 +1948,40 @@
 }
 
+void UIVMActivityMonitorCloud::determineTotalRAMAmount()
+{
+    CForm comForm = m_comMachine.GetDetailsForm();
+    /* Ignore cloud machine errors: */
+    if (m_comMachine.isOk())
+    {
+        /* Common anchor for all fields: */
+        const QString strAnchorType = "cloud";
+
+        /* For each form value: */
+        const QVector<CFormValue> values = comForm.GetValues();
+        foreach (const CFormValue &comIteratedValue, values)
+        {
+            /* Ignore invisible values: */
+            if (!comIteratedValue.GetVisible())
+                continue;
+
+            /* Acquire label: */
+            const QString strLabel = comIteratedValue.GetLabel();
+            if (strLabel != "RAM")
+                continue;
+
+            AssertReturnVoid((comIteratedValue.GetType() == KFormValueType_RangedInteger));
+
+            CRangedIntegerFormValue comValue(comIteratedValue);
+            m_iTotalRAM = comValue.GetInteger();
+            QString strRAMUnit = comValue.GetSuffix();
+            if (strRAMUnit.compare("gb", Qt::CaseInsensitive) == 0)
+                m_iTotalRAM *= _1G / _1K;
+            else if (strRAMUnit.compare("mb", Qt::CaseInsensitive) == 0)
+                m_iTotalRAM *= _1M / _1K;
+            if (!comValue.isOk())
+                m_iTotalRAM = 0;
+        }
+    }
+}
 
 void UIVMActivityMonitorCloud::setMachine(const CCloudMachine &comMachine)
@@ -1988,4 +2031,13 @@
         else if (enmMetricType == KMetricType_DiskBytesWritten)
             cacheDiskWrite(timeStamps[i], (int)data[i].toFloat());
+        else if (enmMetricType == KMetricType_MemoryUtilization)
+        {
+            if (m_iTotalRAM != 0)
+            {
+                /* calculate used RAM amount in kb: */
+                quint64 iUsedRAM = data[i].toFloat() * (m_iTotalRAM / 100.f);
+                updateRAMChart(iUsedRAM, timeStamps[i]);
+            }
+        }
     }
     sender()->deleteLater();
@@ -2089,4 +2141,6 @@
         m_infoLabels[m_strNetworkMetricName]->setText(strInfo);
     }
+    if (m_charts.contains(m_strNetworkMetricName))
+        m_charts[m_strNetworkMetricName]->update();
 }
 
@@ -2110,4 +2164,24 @@
     if (m_charts.contains(m_strDiskIOMetricName))
         m_charts[m_strDiskIOMetricName]->update();
+}
+
+void UIVMActivityMonitorCloud::updateRAMChart(quint64 iUsedRAM, const QString &strLabel)
+{
+    UIMetric &RAMMetric = m_metrics[m_strRAMMetricName];
+    RAMMetric.setMaximum(m_iTotalRAM);
+    RAMMetric.addData(0, iUsedRAM, strLabel);
+
+    if (m_infoLabels.contains(m_strRAMMetricName)  && m_infoLabels[m_strRAMMetricName])
+    {
+        QString strInfo;
+        strInfo = QString("<b>%1</b><br/>%2: %3<br/>%4: %5<br/>%6: %7").arg(m_strRAMInfoLabelTitle)
+            .arg(m_strRAMInfoLabelTotal).arg(UITranslator::formatSize(_1K * m_iTotalRAM, g_iDecimalCount))
+            .arg(m_strRAMInfoLabelFree).arg(UITranslator::formatSize(_1K * (m_iTotalRAM - iUsedRAM), g_iDecimalCount))
+            .arg(m_strRAMInfoLabelUsed).arg(UITranslator::formatSize(_1K * iUsedRAM, g_iDecimalCount));
+        m_infoLabels[m_strRAMMetricName]->setText(strInfo);
+    }
+
+    if (m_charts.contains(m_strRAMMetricName))
+        m_charts[m_strRAMMetricName]->update();
 }
 
@@ -2132,9 +2206,11 @@
 void UIVMActivityMonitorCloud::prepareMetrics()
 {
-    // UIMetric ramMetric(m_strRAMMetricName, metrics[i].GetUnit(), m_iMaximumQueueSize);
-    // ramMetric.setDataSeriesName(0, "Free");
-    // ramMetric.setDataSeriesName(1, "Used");
-    // ramMetric.setRequiresGuestAdditions(true);
-    // m_metrics.insert(m_strRAMMetricName, ramMetric);
+    /* RAM Metric: */
+    if (m_iTotalRAM != 0)
+    {
+        UIMetric ramMetric(m_strRAMMetricName, "kb", m_iMaximumQueueSize);
+        ramMetric.setDataSeriesName(0, "Used");
+        m_metrics.insert(m_strRAMMetricName, ramMetric);
+    }
 
     /* CPU Metric: */
Index: trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.h	(revision 102744)
+++ trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.h	(revision 102746)
@@ -338,7 +338,8 @@
     /** @name The following functions update corresponding metric charts and labels with new values
       * @{ */
-        virtual void updateCPUChart(ULONG iLoadPercentage, const QString &strLabel);
-        virtual void updateNetworkChart(quint64 uReceive, quint64 uTransmit, const QString &strLabel);
-        virtual void updateDiskIOChart(quint64 uWriteRate, quint64 uReadRate, const QString &strLabel);
+        void updateCPUChart(ULONG iLoadPercentage, const QString &strLabel);
+        void updateNetworkChart(quint64 uReceive, quint64 uTransmit, const QString &strLabel);
+        void updateDiskIOChart(quint64 uWriteRate, quint64 uReadRate, const QString &strLabel);
+        void updateRAMChart(quint64 iUsagePercentage, const QString &strLabel);
     /** @} */
     virtual void resetCPUInfoLabel();
@@ -356,4 +357,5 @@
     bool findMetric(KMetricType enmMetricType, UIMetric &metric, int &iDataSeriesIndex) const;
     void prepareMetrics();
+    void determineTotalRAMAmount();
 
     CCloudMachine m_comMachine;
@@ -370,5 +372,6 @@
     QMap<QString, quint64> m_networkReceiveCache;
     QMap<QString, quint64> m_networkTransmitCache;
-
+    /** Total amount of RAM in kb. */
+    quint64 m_iTotalRAM;
 };
 #endif /* !FEQT_INCLUDED_SRC_activity_vmactivity_UIVMActivityMonitor_h */
