google-ar / sceneform-android-sdk

Sceneform SDK for Android
https://developers.google.com/sceneform/develop/
Apache License 2.0
1.23k stars 604 forks source link

App Crash #1034

Open ChanduMnS opened 4 years ago

ChanduMnS commented 4 years ago

Hi ,

My app is crashing very frequently. When I saw the profiler for the same issue, I found lot of memory is been consumed by Vector class. My app is crashing giving out of memory error. Please find the error log below: I/native: plane_detection_manager.cc:495 Landmarks were not processed due to previous landmarks still being computed. W/Adreno-GSL: <sharedmem_gpuobj_alloc:2339>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory E/Adreno-GSL: <gsl_memory_alloc_pure:2209>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed. W/Adreno-GSL: <sharedmem_gpuobj_alloc:2339>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory E/Adreno-GSL: <gsl_memory_alloc_pure:2209>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed. W/Adreno-GSL: <sharedmem_gpuobj_alloc:2339>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory E/Adreno-GSL: <gsl_memory_alloc_pure:2209>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed. W/Adreno-GSL: <sharedmem_gpuobj_alloc:2339>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory E/Adreno-GSL: <gsl_memory_alloc_pure:2209>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed. W/Adreno-GSL: <sharedmem_gpuobj_alloc:2339>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory E/Adreno-GSL: <gsl_memory_alloc_pure:2209>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed. W/Adreno-GSL: <sharedmem_gpuobj_alloc:2339>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory E/Adreno-GSL: <gsl_memory_alloc_pure:2209>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed. W/Adreno-GSL: <sharedmem_gpuobj_alloc:2339>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory E/Adreno-GSL: <gsl_memory_alloc_pure:2209>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed. W/Adreno-GSL: <sharedmem_gpuobj_alloc:2339>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory E/Adreno-GSL: <gsl_memory_alloc_pure:2209>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed. W/Adreno-GSL: <sharedmem_gpuobj_alloc:2339>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory E/Adreno-GSL: <gsl_memory_alloc_pure:2209>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed. W/Adreno-GSL: <sharedmem_gpuobj_alloc:2339>: sharedmem_gpumem_alloc: mmap failed errno 12 Out of memory E/Adreno-GSL: <gsl_memory_alloc_pure:2209>: GSL MEM ERROR: kgsl_sharedmem_alloc ioctl failed. A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x1a in tid 6011 (FEngine::loop), pid 5927

I've disabled the fragment element and checked for the rest of the processes. It's below 400MB, but while I added arfragment the memory gets pilled up to more than 1GB in many instances. I've tested this on moto g5 plus , one plus 7 and Google Pixel 3 . I'm getting the error in both the phones. I'm getting this error without placing anchors on the plane or sometimes without detecting the plane also. Kindly help me to solve this.

I'm Using implementation 'androidx.appcompat:appcompat:1.1.0'. Is there any constraint that I've to use only android? As I see in here says the issue solved with android version:

https://github.com/google-ar/sceneform-android-sdk/issues/248#issuecomment-412899327 - I've tried the version mentioned there also i.e 27.1.1 also. But I didn't find any luck on this.

https://github.com/google-ar/sceneform-android-sdk/issues/1031#issue-589197598 - this also addresses the androidx issue.

https://github.com/google-ar/sceneform-android-sdk/issues/295#issuecomment-428656448 - Is support for Androidx causing this issue but `

implementation 'com.android.support:design:27.1.0' implementation 'com.android.support:appcompat-v7:27.1.0'is also causing error? Am using implementation 'com.google.ar:core:1.15.0' implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.15.0'` My app.gradle file

apply plugin: 'com.android.application' apply plugin: 'com.google.ar.sceneform.plugin'

android { compileSdkVersion 27 buildToolsVersion "28.0.3" defaultConfig { applicationId "" minSdkVersion 26 targetSdkVersion 27 versionCode 12 versionName "1.1.3.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } defaultConfig { // Sceneform requires minSdkVersion >= 24. minSdkVersion 26

}
// Sceneform libraries use language constructs from Java 8.
// Add these compile options if targeting minSdkVersion < 26.
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

}

Device Information: Name : Moto g5s plus OS: Android 8.1.0

https://github.com/google-ar/sceneform-android-sdk/issues/958#issue-542793438 - also reports the crash

Or is there a way to handle this exception? In the profiler I see that most of the memory is used by the graphics. image

Is there any recommendation for the device to use? Are there any specific recommendation on RAM, HeapSize etc.,? https://github.com/google-ar/sceneform-android-sdk/issues/60#issue-328202828 I'd like to know about the memory optimisation of the scene, if I can work on that kindly provide any resources.

ChanduMnS commented 4 years ago

I found the same pattern in hellosceneform example. Is there anybody there to help? @malik-at-work @inio @gstanlo @

ChanduMnS commented 4 years ago

To add to the above information. I've multiple fragments and other button actions in my activity. I'm placing the arfragment in the constraint layout. I happened to see some memory leak issues. https://github.com/google-ar/sceneform-android-sdk/issues/719 https://github.com/google-ar/sceneform-android-sdk/issues/538 https://github.com/google-ar/sceneform-android-sdk/issues/413 Is this is because of the memory leak. I tried the hellosceneform app from the samples and PFB the profiler output : Android Studio 3.6 Mobile: Moto g5s plus OS: Oreo 8.1 image

Kindly help me out of this. @malik-at-work Your help will be very much appreciated.

ChanduMnS commented 4 years ago

I didn't find the app crash below 1.12 version. Kindly let me know if this is a known bug.