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

java.lang.OutOfMemoryError #171

Closed
manuel-sejourne opened this issue Dec 12, 2017 · 5 comments
Closed

java.lang.OutOfMemoryError #171

manuel-sejourne opened this issue Dec 12, 2017 · 5 comments

Comments

@manuel-sejourne
Copy link

Hi,

We found an issue on our PRODUCTION app


java.lang.OutOfMemoryError: Could not allocate JNI Env
--
  | 1 | at java.lang.Thread.nativeCreate(Thread.java)
  | 2 | at java.lang.Thread.start(Thread.java:1063)
  | 3 | at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:921)
  | 4 | at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1328)
  | 5 | at java.util.concurrent.Executors$DelegatedExecutorService.execute(Executors.java:584)
  | 6 | at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:620)
! | 7 | at com.optimizely.ab.android.datafile_handler.DatafileLoader.getDatafile(DatafileLoader.java:77)
  | 8 | at com.optimizely.ab.android.datafile_handler.DatafileService.onStartCommand(DatafileService.java:73)


Thanks in advance for solving this issue

Bests

@manuel-sejourne
Copy link
Author

manuel-sejourne commented Dec 12, 2017

I use this version :

 implementation('com.optimizely.ab:android-sdk:1.4.0', {
        exclude group: 'com.android.support.test.espresso'
    })

Does the new version solve this issue ?

@thomaszurkan-optimizely
Copy link
Contributor

  1. What is your datadownload interval set to (should probably be at least a few minutes Android O has a min of 15 minutes)?
  2. Since it is from a service intent, it is in a separate thread that dies so worst case, the intent should just not complete.
  3. We don't have a try catch around that and we should. But, the initialize is being refactored and that call will no longer exist in its current state.

@manuel-sejourne
Copy link
Author

manuel-sejourne commented Dec 18, 2017

Hi,

My answers:

.withDatafileDownloadInterval(60)
.withEventDispatchInterval(60)

@thomaszurkan-optimizely
Copy link
Contributor

@manuel-sejourne So, it is updating every 60 seconds which is quite a lot. But, have you profiled the app to see where the memory leak is coming from? Just because it died there doesn't mean that's where the memory leak is. We have cleaned up all our resources in 1.4 and I don't think we have any memory leaks.

@thomaszurkan-optimizely
Copy link
Contributor

@manuel-sejourne Question: Was it in API 24? I see some weird stuff when profiling and there are lots of stack overflow on memory leaks in this version.

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