Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

启用通知栏日志时下载大文件(1.1G),内存溢出闪退 #174

Open
Fonnson opened this issue May 26, 2023 · 3 comments
Open
Labels
寻求帮助 Extra attention is needed 第三方问题

Comments

@Fonnson
Copy link

Fonnson commented May 26, 2023

问题描述

1.1G的文件下载到191 MB就会提示内存溢出,之后设置了禁止缓存还是一样。
setCacheControl(CacheControl.Builder().noStore().noCache().build()) // 完全禁止读取/写入缓存

期望行为

可以完整下载1.1G的文件

如何复现

fork仓库并复现问题可以快速解决, 猜测只会让问题晦涩难懂, 耽误所有人时间

截图

image

异常堆栈信息或者手机截图/视频(拖拽到输入框即可上传)

版本

  • Net: 3.5.8
  • OkHttp: 4.10.0
  • Android: 33
  • Gradle: 7.4.1
  • Android Studio: Android Studio Flamingo | 2022.2.1 Patch 1
@Fonnson Fonnson added the 寻求帮助 Extra attention is needed label May 26, 2023
@liangjingkanji
Copy link
Owner

liangjingkanji commented May 26, 2023

请fork仓库在demo中复现此问题

本框架直接调用的okhttp下载, 或者你可以试下搜索okhttp+问题描述来解决

@sgfb
Copy link

sgfb commented Jun 27, 2023

问题来自使用了通知栏监听网络日志的拦截器导致,移除即可。
代码来自com.drake.net.sample.base.APP

// 通知栏监听网络日志
if (BuildConfig.DEBUG) {
    addInterceptor(
        ChuckerInterceptor.Builder(this@App)
            .collector(ChuckerCollector(this@App))
            .maxContentLength(250000L)
            .redactHeaders(emptySet())
            .alwaysReadResponseBody(false)
            .build()
    )
}

@liangjingkanji
Copy link
Owner

我给官方提了这个问题 Duplicate of ChuckerTeam/chucker#1068

@liangjingkanji liangjingkanji changed the title 下载大文件(1.1G),内存溢出闪退。 启用通知栏日志时下载大文件(1.1G),内存溢出闪退 Jul 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
寻求帮助 Extra attention is needed 第三方问题
Projects
None yet
Development

No branches or pull requests

3 participants