# Stressing the JVM GC on Android

DevFeed: [Stressing the JVM GC on Android](<https://devfeed.tech/articles/stressing-the-jvm-gc-on-android-28537.md>)

Original publisher: [Read original article](<https://www.amanjeet.me/stressing-the-jvm-gc-on-android/>)

Author: Amanjeet Singh Gurtatta

Published: 2024-03-10T08:49:55Z

Content type: tutorial

Language: en

Sources: [Amanjeet Singh](<https://devfeed.tech/sources/amanjeet-singh.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [Java](<https://devfeed.tech/topics/java.md>), [Code](<https://devfeed.tech/topics/code.md>), [now-in-android](<https://devfeed.tech/topics/now-in-android.md>)

Tags: [adb](<https://devfeed.tech/tags/adb.md>), [android](<https://devfeed.tech/tags/android.md>), [android-vitals](<https://devfeed.tech/tags/android-vitals.md>), [anr](<https://devfeed.tech/tags/anr.md>), [fragmentation](<https://devfeed.tech/tags/fragmentation.md>), [gc](<https://devfeed.tech/tags/gc.md>), [java](<https://devfeed.tech/tags/java.md>), [leak](<https://devfeed.tech/tags/leak.md>), [memory](<https://devfeed.tech/tags/memory.md>), [memory-leak](<https://devfeed.tech/tags/memory-leak.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [mobile-performance](<https://devfeed.tech/tags/mobile-performance.md>), [now-in-android](<https://devfeed.tech/tags/now-in-android.md>), [outofmemory](<https://devfeed.tech/tags/outofmemory.md>), [performance](<https://devfeed.tech/tags/performance.md>), [stress](<https://devfeed.tech/tags/stress.md>), [stresstest](<https://devfeed.tech/tags/stresstest.md>)

## AI overview

This tutorial describes GCStress, a Java application that deliberately creates garbage-collection pressure through repeated random byte-array allocations and cache removals. It explains how to integrate it into Google's Now in Android app, trigger it with an Android broadcast and adb, and observe effects such as skipped UI frames, possible ANRs, and potential out-of-memory errors.

## Source excerpt

This post talks about a way to stress Java garbage collector.