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

app长时间处于后台报错如下 #515

Open
yx1025 opened this issue Sep 3, 2024 · 1 comment
Open

app长时间处于后台报错如下 #515

yx1025 opened this issue Sep 3, 2024 · 1 comment

Comments

@yx1025
Copy link

yx1025 commented Sep 3, 2024

java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again
at java.lang.Thread.nativeCreate(Thread.java)
at java.lang.Thread.start(Thread.java:883)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:975)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1382)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
at com.qiniu.android.dns.dns.DnsResolver.request(DnsResolver.java:114)
at com.qiniu.android.dns.dns.DnsResolver.lookupHost
at com.qiniu.android.dns.dns.DnsResolver.resolve(DnsResolver.java:52)
at com.qiniu.android.http.dns.HttpDns.lookup(HttpDns.java:44)
at com.qiniu.android.http.dns.DnsPrefetcher.preFetchHost(DnsPrefetcher.java:299)
at com.qiniu.android.http.dns.DnsPrefetcher.preFetchHosts(DnsPrefetcher.java:265)
at com.qiniu.android.http.dns.DnsPrefetcher.preFetchHosts(DnsPrefetcher.java:237)
at com.qiniu.android.http.dns.DnsPrefetcher.checkWhetherCachedDnsValid(DnsPrefetcher.java:191)
at com.qiniu.android.http.dns.DnsPrefetchTransaction$4.run
at com.qiniu.android.transaction.TransactionManager$Transaction.handleAction(TransactionManager.java:214)
at com.qiniu.android.transaction.TransactionManager$Transaction.access$000
at com.qiniu.android.transaction.TransactionManager.handleTransaction
at com.qiniu.android.transaction.TransactionManager.handleAllTransaction(TransactionManager.java:92)
at com.qiniu.android.transaction.TransactionManager.timerAction(TransactionManager.java:124)
at com.qiniu.android.transaction.TransactionManager.access$100
at com.qiniu.android.transaction.TransactionManager$1.run
at java.util.TimerThread.mainLoop(Timer.java:562)
at java.util.TimerThread.run(Timer.java:512)

@YangSen-qn
Copy link
Contributor

YangSen-qn commented Sep 5, 2024

@yx1025
看起来是手机内存使用问题,可能和手机内存大小有关,也可能和其他 APP 有关,只不过七牛 SDK 在申请内存时正好触发了 OOM。

七牛 SDK 使用时的注意点:

  1. 上传时尽可能控制并发上传得文件数量(比如:3个),这是 APP 需要实现的逻辑
  2. 上传分片配置不要太大,我们推荐使用默认值
  3. 上传分片阈值不要太大,我们推荐使用默认值

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants