使用Firebase

时间:2016-06-09 19:27:46

标签: android firebase

我实施了firebase google(com.google.firebase:firebase-auth:9.0.2),但是当我打电话时

  

FirebaseAuth mFirebaseAuth = FirebaseAuth.getInstance();

我收到消息内存不足。我是初学者,我不知道原因。我该如何解决这个问题? 这是日志:

  

1.424 4944-4944 / com.bsp.androidtraining E / art:抛出OutOfMemoryError"无法分配带有12个空闲字节的162字节分配和12B直到OOM" (递归案例)   06-10 02:03:51.454 4944-4944 / com.bsp.androidtraining E / art:" main" prio = 5 tid = 1可运行   06-10 02:03:51.454 4944-4944 / com.bsp.androidtraining E / art:|基团="主" 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:|持有互斥锁=" mutator lock"(共享持有)   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时抛出OutOfMemoryError;没有可用的堆栈

1 个答案:

答案 0 :(得分:1)

如果在Manifest.xml文件中设置android:largeHeap="true",内存不足错误通常会消失 - 但在大多数情况下,应注意确保不会在内存中不必要地加载大量数据。例如,请查看这篇密切相关的文章here中的讨论。

但是,在您的情况下,我认为您只需在android:largeHeap="true"文件中设置Manifest.xml即可。这应该有所帮助。