protected void checkUsedMemory(long expectedMax)
{
/*
- * request garbage collection and wait briefly for it to run;
+ * request garbage collection and wait for it to run;
* NB there is no guarantee when, or whether, it will do so
+ * wait time depends on JRE/processor, generous allowance here
*/
System.gc();
- waitFor(100);
+ waitFor(1500);
/*
* a second gc() call should not be necessary - but it is!
* the test passes with it, and fails without it
*/
System.gc();
- waitFor(100);
+ waitFor(1500);
/*
* check used memory is 'reasonably low'