Make tests robust against GCs failing early

044-proxy, 064-field-access, 080-oom-throw, and 617-clinit-oome
all intentionally run out of memory, and then try to run a
test with a full heap. In the presence of aosp/1286274, this can fail
if we initially had some empty space in the heap. A GC may recover
< 1% of space, in which case we return OOME. But later allocations
may still succeed.

The fix is to make sure there is no empty space in the heap when
we start. If we end up performing a forced GC, the heap was completely
full. Since no memory is dropped during this process, the heap will
still be full when we finish.

Test: testrunner.py --host -t 044-proxy &
Test: testrunner.py --host -t 080-oom-throw
Change-Id: I10e3f77cd16d25af96751d039e2e498e1cb43315
4 files changed