Index: /trunk/src/VBox/ValidationKit/testdriver/vbox.py
===================================================================
--- /trunk/src/VBox/ValidationKit/testdriver/vbox.py	(revision 61949)
+++ /trunk/src/VBox/ValidationKit/testdriver/vbox.py	(revision 61950)
@@ -761,4 +761,6 @@
         oSession = self.oSession;
         if oSession is not None: # paranoia
+            if sErrId == 'HostMemoryLow':
+                oSession.signalHostMemoryLow();
             oSession.signalTask();
         self.oVBoxMgr.interruptWaitEvents();
@@ -2551,76 +2553,81 @@
 
         #
-        # Pause the VM if we're going to take any screenshots or dig into the
-        # guest.  Failures are quitely ignored.
-        #
-        if self.fAlwaysUploadLogs or reporter.testErrorCount() > 0:
-            try:
-                if oSession.oVM.state in [ vboxcon.MachineState_Running,
-                                           vboxcon.MachineState_LiveSnapshotting,
-                                           vboxcon.MachineState_Teleporting ]:
-                    oSession.o.console.pause();
-            except:
-                reporter.logXcpt();
-
-        #
-        # Take Screenshot and upload it (see below) to Test Manager if appropriate/requested.
+        # If the host is out of memory, just skip all the info collection as it
+        # requires memory too and seems to wedge.
         #
         sLastScreenshotPath = None;
-        if fTakeScreenshot is True  or  self.fAlwaysUploadScreenshots  or  reporter.testErrorCount() > 0:
-            sLastScreenshotPath = os.path.join(self.sScratchPath, "LastScreenshot-%s.png" % oSession.sName);
-            fRc = oSession.takeScreenshot(sLastScreenshotPath);
-            if fRc is not True:
-                sLastScreenshotPath = None;
-
-        # Query the OS kernel log from the debugger if appropriate/requested.
-        sOsKernelLog = None;
-        if self.fAlwaysUploadLogs or reporter.testErrorCount() > 0:
-            sOsKernelLog = oSession.queryOsKernelLog();
-
-        # Do "info vgatext all" separately.
-        sVgaText = None;
-        if self.fAlwaysUploadLogs or reporter.testErrorCount() > 0:
-            sVgaText = oSession.queryDbgInfoVgaText();
-
-        # Various infos (do after kernel because of symbols).
-        asMiscInfos = [];
-        if self.fAlwaysUploadLogs or reporter.testErrorCount() > 0:
-            # Dump the guest stack for all CPUs.
-            cCpus = oSession.getCpuCount();
-            if cCpus > 0:
-                for iCpu in xrange(0, cCpus):
-                    sThis = oSession.queryDbgGuestStack(iCpu);
+        sOsKernelLog        = None;
+        sVgaText            = None;
+        asMiscInfos         = [];
+        if not oSession.fHostMemoryLow:
+            #
+            # Pause the VM if we're going to take any screenshots or dig into the
+            # guest.  Failures are quitely ignored.
+            #
+            if self.fAlwaysUploadLogs or reporter.testErrorCount() > 0:
+                try:
+                    if oSession.oVM.state in [ vboxcon.MachineState_Running,
+                                               vboxcon.MachineState_LiveSnapshotting,
+                                               vboxcon.MachineState_Teleporting ]:
+                        oSession.o.console.pause();
+                except:
+                    reporter.logXcpt();
+
+            #
+            # Take Screenshot and upload it (see below) to Test Manager if appropriate/requested.
+            #
+            if fTakeScreenshot is True  or  self.fAlwaysUploadScreenshots  or  reporter.testErrorCount() > 0:
+                sLastScreenshotPath = os.path.join(self.sScratchPath, "LastScreenshot-%s.png" % oSession.sName);
+                fRc = oSession.takeScreenshot(sLastScreenshotPath);
+                if fRc is not True:
+                    sLastScreenshotPath = None;
+
+            # Query the OS kernel log from the debugger if appropriate/requested.
+            if self.fAlwaysUploadLogs or reporter.testErrorCount() > 0:
+                sOsKernelLog = oSession.queryOsKernelLog();
+
+            # Do "info vgatext all" separately.
+            if self.fAlwaysUploadLogs or reporter.testErrorCount() > 0:
+                sVgaText = oSession.queryDbgInfoVgaText();
+
+            # Various infos (do after kernel because of symbols).
+            if self.fAlwaysUploadLogs or reporter.testErrorCount() > 0:
+                # Dump the guest stack for all CPUs.
+                cCpus = oSession.getCpuCount();
+                if cCpus > 0:
+                    for iCpu in xrange(0, cCpus):
+                        sThis = oSession.queryDbgGuestStack(iCpu);
+                        if sThis is not None and len(sThis) > 0:
+                            asMiscInfos += [
+                                '================ start guest stack VCPU %s ================\n' % (iCpu,),
+                                sThis,
+                                '================ end guest stack VCPU %s ==================\n' % (iCpu,),
+                            ];
+
+                for sInfo, sArg in [ ('mode', 'all'),
+                                     ('fflags', ''),
+                                     ('cpumguest', 'verbose all'),
+                                     ('cpumguestinstr', 'symbol all'),
+                                     ('pic', ''),
+                                     ('apic', ''),
+                                     ('ioapic', ''),
+                                     ('pit', ''),
+                                     ('phys', ''),
+                                     ('clocks', ''),
+                                     ('timers', ''),
+                                     ('gdtguest', ''),
+                                     ('ldtguest', ''),
+                                    ]:
+                    if sInfo in ['apic',] and self.fpApiVer < 5.1: # asserts and burns
+                        continue;
+                    sThis = oSession.queryDbgInfo(sInfo, sArg);
                     if sThis is not None and len(sThis) > 0:
+                        if sThis[-1] != '\n':
+                            sThis += '\n';
                         asMiscInfos += [
-                            '================ start guest stack VCPU %s ================\n' % (iCpu,),
+                            '================ start %s %s ================\n' % (sInfo, sArg),
                             sThis,
-                            '================ end guest stack VCPU %s ==================\n' % (iCpu,),
+                            '================ end %s %s ==================\n' % (sInfo, sArg),
                         ];
-
-            for sInfo, sArg in [ ('mode', 'all'),
-                                 ('fflags', ''),
-                                 ('cpumguest', 'verbose all'),
-                                 ('cpumguestinstr', 'symbol all'),
-                                 ('pic', ''),
-                                 ('apic', ''),
-                                 ('ioapic', ''),
-                                 ('pit', ''),
-                                 ('phys', ''),
-                                 ('clocks', ''),
-                                 ('timers', ''),
-                                 ('gdtguest', ''),
-                                 ('ldtguest', ''),
-                                ]:
-                if sInfo in ['apic',] and self.fpApiVer < 5.1: # asserts and burns
-                    continue;
-                sThis = oSession.queryDbgInfo(sInfo, sArg);
-                if sThis is not None and len(sThis) > 0:
-                    if sThis[-1] != '\n':
-                        sThis += '\n';
-                    asMiscInfos += [
-                        '================ start %s %s ================\n' % (sInfo, sArg),
-                        sThis,
-                        '================ end %s %s ==================\n' % (sInfo, sArg),
-                    ];
 
         #
Index: /trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py
===================================================================
--- /trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py	(revision 61949)
+++ /trunk/src/VBox/ValidationKit/testdriver/vboxwrappers.py	(revision 61950)
@@ -538,4 +538,5 @@
         self.oConsoleEventHandler   = None;
         self.uPid                   = None;
+        self.fHostMemoryLow         = False;    # see signalHostMemoryLow; read-only for outsiders.
 
         try:
@@ -708,4 +709,15 @@
             self.oConsoleEventHandler.unregister();
             self.oConsoleEventHandler = None;
+
+
+    def signalHostMemoryLow(self):
+        """
+        Used by a runtime error event handler to indicate that we're low on memory.
+        Signals the task.
+        """
+        self.fHostMemoryLow = True;
+        self.signalTask();
+        return True;
+
 
     def assertPoweredOff(self):
