nextcloud / nextcloud/android

Too many conflicts seems to lead to java.lang.OutOfMemoryError

Open
#10,633 3 comments 1 reaction 0 assignees View on GitHub
bug feature: auto upload hotspot: large upload queue hotspot: sync conflicts performance: OOM :brain: stable-3.21
Dominant language
Kotlin
Stars
5.6k
Forks
2k
Avg merge
2d 18h
Merged PRs (30d)
92

Description

### ⚠️ Before posting ⚠️

- [X] This is a **bug**, not a question or an enhancement.
- [X] I've [searched for similar issues](https://github.com/nextcloud/android/issues) and didn't find a duplicate.
- [X] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
- [X] I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/).

### Steps to reproduce

Install next loud app on device with a load of pictures and sync

Factory reset without formatting SDcard

Install next loud app again and re-enable auto upload

Have conflicts with more then 2000 files with exactly the same content

Run out of memory on the device

### Expected behaviour

Either Skip over duplicates (preferred)

Not run out of memory

### Actual behaviour

### Cause of error
```java
Exception in thread "Thread-7" java.lang.OutOfMemoryError: Failed to allocate a 40 byte allocation with 4138920 free bytes and 4041KB until OOM, target footprint 536870912, growth limit 536870912; giving up on allocation because <1% of heap free after GC.
at sun.security.util.DerValue.getDataBytes(DerValue.java:648)
at sun.security.x509.AVA.toRFC2253CanonicalString(AVA.java:933)
at sun.security.x509.RDN.toRFC2253StringInternal(RDN.java:444)
at sun.security.x509.RDN.toRFC2253String(RDN.java:424)
at sun.security.x509.X500Name.getRFC2253CanonicalName(X500Name.java:730)
at sun.security.x509.X500Name.hashCode(X500Name.java:383)
at javax.security.auth.x500.X500Principal.hashCode(X500Principal.java:487)
at java.util.HashMap.hash(HashMap.java:338)
at java.util.LinkedHashMap.get(LinkedHashMap.java:464)
at okhttp3.internal.tls.BasicTrustRootIndex.(BasicTrustRootIndex.kt:57)
at okhttp3.internal.platform.Platform.buildTrustRootIndex(Platform.kt:163)
at okhttp3.internal.platform.Platform.buildCertificateChainCleaner(Platform.kt:160)
at okhttp3.internal.platform.Android10Platform.buildCertificateChainCleaner(Android10Platform.kt:82)
at okhttp3.internal.tls.CertificateChainCleaner$Companion.get(CertificateChainCleaner.kt:42)
at okhttp3.OkHttpClient$Builder.sslSocketFactory(OkHttpClient.kt:870)
at com.nextcloud.common.PlainClient$Companion.createDefaultClient(PlainClient.kt:62)
at com.nextcloud.common.PlainClient$Companion.access$createDefaultClient(PlainClient.kt:47)
at com.nextcloud.common.PlainClient.(PlainClient.kt:45)
at com.nextcloud.client.network.ClientFactoryImpl.createPlainClient(ClientFactoryImpl.java:94)
at com.nextcloud.client.network.ConnectivityServiceImpl.isInternetWalled(ConnectivityServiceImpl.java:79)
at com.owncloud.android.files.services.FileUploader.retryFailedUploads(FileUploader.java:1093)
at com.owncloud.android.utils.FilesSyncHelper.lambda$restartJobsIfNeeded$0(FilesSyncHelper.java:240)
at com.owncloud.android.utils.FilesSyncHelper$$ExternalSyntheticLambda0.run(Unknown Source:10)
at java.lang.Thread.run(Thread.java:920)

```

### App information
* ID: `com.nextcloud.client`
* Version: `30210090`
* Build flavor: `gplay`

### Device information
* Brand: `samsung`
* Device: `heroltexx`
* Model: `SM-G930F`
* Id: `SQ3A.220705.003.A1`
* Product: `heroltexx`

### Firmware
* SDK: `32`
* Release: `12`
* Incremental: `eng.ivanme.20220806.144850`

### Android version

12.1l

### Device brand and model

s7

### Stock or custom OS?

Custom (explain in "additional information")

### Nextcloud android app version

30210090

### Nextcloud server version

22.2.3

### Using a reverse proxy?

Yes

### Android logs

_No response_

### Server error logs

_No response_

### Additional information

LOS 19.1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.