2

Our application sometimes uses a lot of memory, and this is expected. But when we test it under high load on Windows XP, we usually get the very annoying "Your system is running low on virtual memory" popup, and this prevents our automated, unattended, tests to run through...

Is it possible to prevent this popup to appear, and just have the allocation fail? The app will handle it gracefully, and tests will go on...

We are using Windows XP, but if a solution only exists on later versions, I'd be happy to know anyway.

Xavier Nodet
  • 5,033
  • 2
  • 37
  • 48
  • Buy more RAM and disable swap is what I can think of at the moment. – moshbear Nov 29 '11 at 10:25
  • 1
    There's some discussion on a similar line here: http://stackoverflow.com/questions/192876/set-windows-process-or-user-memory-limit – Vicky Nov 29 '11 at 10:25
  • We need to check that our app behaves correctly in this situation, so we really want to trigger a 'low memory condition'. But we want this to run in scripted tests, without anyone available to click on any button... – Xavier Nodet Nov 29 '11 at 10:30
  • Thanks for the link, @Vicky, but I don't see how this other thread can help me: what I want is to have Windows not bother the user with the question, and just fail to allocate the memory... – Xavier Nodet Nov 29 '11 at 10:34
  • 1
    It was mostly Adam Mitz's answer about using Job Objects http://msdn.microsoft.com/en-us/library/ms684161%28VS.85%29.aspx that looked interesting. If you limit the amount of memory available to your process, you won't get "System" warning errors because the system will still be fine, just your process will not be able to allocate more memory. – Vicky Nov 29 '11 at 12:24
  • Good point, @Vicky. Entails some Windows-specific changes to our tests, but probably better than the current situation... Thanks. – Xavier Nodet Nov 29 '11 at 13:16

1 Answers1

0

You might get along with a kind of global dialog handler that catches that dialog and cancels it away.

QTP (HP QuickTest Professional) has GUI exception handlers (or what are they called?), and (IBM) Rational Functional Tester has a similar mechanism.

Basically, you define a chain of handlers to be executed when "standard" playback fails. In the handler, you inspect the situation at hand, and depending on the circumstances, you act upon it appropriately, for example you let the robot click the close button on the "memory is getting low" message.

In earlier implementations of QTP, those handlers where checked for a trigger match asynchroneously, eating up CPU cycles during test execution. Newer versions (9+ I think) don´t do that anymore.

Since the dialog is "very modal", i.e. created by the system, it might not be reachable for the test robot. Then this won´t help, of course...

You did not mention which test robot (if any) you use, so I cannot know if this helps.

TheBlastOne
  • 4,291
  • 3
  • 38
  • 72