Reduce flakiness of 004-NativeAllocations test.

Under a GSS configuration, calls to registerNativeAllocation trigger
blocking GC instead of concurrent GC, which means the main thread in the
test can end up holding on to deadlockLock for longer than the finalizer
timeout.

The fix is to reduce the calls to registerNativeAlloation required to
trigger the deadlock scenario.

Bug: 68792448
Test: ./test/testrunner/testrunner.py -b -t 004-NativeAllocations
Test: Verify test catches deadlock case on buggy versions of art.
Change-Id: Ide417de7a5cad593afd2877054f88588b7a32be3
diff --git a/test/004-NativeAllocations/src-art/Main.java b/test/004-NativeAllocations/src-art/Main.java
index 29f907d..6b1c48d 100644
--- a/test/004-NativeAllocations/src-art/Main.java
+++ b/test/004-NativeAllocations/src-art/Main.java
@@ -82,8 +82,8 @@
     // case of blocking registerNativeAllocation.
     private static void triggerBlockingRegisterNativeAllocation() throws Exception {
         long maxMem = Runtime.getRuntime().maxMemory();
-        int size = (int)(maxMem / 32);
-        int allocationCount = 256;
+        int size = (int)(maxMem / 5);
+        int allocationCount = 10;
 
         long total = 0;
         for (int i = 0; i < allocationCount; ++i) {
@@ -111,7 +111,7 @@
         synchronized (deadlockLock) {
             allocateDeadlockingFinalizer();
             while (!aboutToDeadlock) {
-                checkRegisterNativeAllocation();
+                Runtime.getRuntime().gc();
             }
 
             // Do more allocations now that the finalizer thread is deadlocked so that we force