chucker icon indicating copy to clipboard operation
chucker copied to clipboard

OutOfMemoryError: Failed to allocate a 8208 byte allocation with 3418760 free byte

Open liangjingkanji opened this issue 1 year ago • 8 comments

:writing_hand: Describe the bug

Downloading large files (over 150mb) crashes, I'm sure it's Chucker's problem

Exception

Throwing OutOfMemoryError "Failed to allocate a 32 byte allocation with 4673640 free bytes and 4564KB until OOM, target footprint 268435456, growth limit 268435456; failed due to fragmentation (largest possible contiguous allocation 0 bytes). Number of 256KB sized free regions are: 0" (VmSize 6440568 kB, recursive case)

Use

if (BuildConfig.DEBUG) {
    addInterceptor(
        ChuckerInterceptor.Builder(this@App)
            .collector(ChuckerCollector(this@App))
            .maxContentLength(250000L)
            .redactHeaders(emptySet())
            .alwaysReadResponseBody(false)
            .build()
    )
}

:bomb: Steps to reproduce

  1. Clone https://github.com/liangjingkanji/Net/tree/debug
  2. installing - Runing
  3. Wait for the download to be about 150mb
  4. Crash

:wrench: Expected behavior

Do not crash when downloading large files

:camera: Screenshots

image image

:iphone: Tech info

  • Device: Android Simulator
  • OS: Android 13
  • Chucker version: 3.5.2

:page_facing_up: Additional context

I've recommended your project to others a long time ago

liangjingkanji avatar Jul 02 '23 12:07 liangjingkanji