1

I implement firebase google (com.google.firebase:firebase-auth:9.0.2), but when I call

FirebaseAuth mFirebaseAuth = FirebaseAuth.getInstance();

I get message Out of memory. I'm beginner android, I don't know the reason. How I can fix this problem? Here is the log:

1.424 4944-4944/com.bsp.androidtraining E/art: Throwing OutOfMemoryError "Failed to allocate a 162 byte allocation with 12 free bytes and 12B until OOM" (recursive case) 06-10 02:03:51.454 4944-4944/com.bsp.androidtraining E/art: "main" prio=5 tid=1 Runnable 06-10 02:03:51.454 4944-4944/com.bsp.androidtraining E/art: | group="main" sCount=0 dsCount=0 obj=0x7493a000 self=0xb4827800 06-10 02:03:51.454 4944-4944/com.bsp.androidtraining E/art: | sysTid=4944 nice=-11 cgrp=default sched=0/0 handle=0xb6f35bec 06-10 02:03:51.454 4944-4944/com.bsp.androidtraining E/art: | state=R schedstat=( 0 0 0 ) utm=898 stm=49 core=1 HZ=100 06-10 02:03:51.454 4944-4944/com.bsp.androidtraining E/art: | stack=0xbe7e8000-0xbe7ea000 stackSize=8MB 06-10 02:03:51.454 4944-4944/com.bsp.androidtraining E/art: | held mutexes= "mutator lock"(shared held) 06-10 02:03:51.454 4944-4944/com.bsp.androidtraining E/art: native: #00 pc 00004e64 /system/lib/libbacktrace_libc++.so (UnwindCurrent::Unwind(unsigned int, ucontext*)+23) 06-10 02:03:51.454 4944-4944/com.bsp.androidtraining E/art: native: #01 pc 00003665 /system/lib/libbacktrace_libc++.so (Backtrace::Unwind(unsigned int, ucontext*)+8) 06-10 02:03:51.454 4944-4944/com.bsp.androidtraining E/art: native: #02 pc 00244159 /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream >&, int, char const*, art::mirror::ArtMethod*)+68) 06-10 02:03:51.454 4944-4944/com.bsp.androidtraining E/art: native: #03 pc 00227059 /system/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream >&) const+140) 06-10 02:03:51.454 4944-4944/com.bsp.androidtraining E/art: native: #04 pc 0022a31b /system/lib/libart.so (art::Thread::ThrowOutOfMemoryError(char const*)+254)

java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack available

khoai lang
  • 37
  • 3

1 Answers1

1

Out of Memory errors usually disappear if you set android:largeHeap="true" in the Manifest.xml file - but in most cases, care should be taken to ensure you are not unnecessarily loading large amounts of data in memory. For example, look at the discussion in this closely related article here.

However, in your case I think you can just set android:largeHeap="true" in the Manifest.xml file. This should help.

Community
  • 1
  • 1
ishmaelMakitla
  • 3,726
  • 3
  • 25
  • 32