Comments (4)
Do you have a stacktrace?
from rx-preferences.
Caused by java.lang.OutOfMemoryError: Failed to allocate a 79288 byte allocation with 46080 free bytes and 44KB until OOM
at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:95)
at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:146)
at java.lang.StringBuffer.append(StringBuffer.java:219)
at java.io.StringWriter.write(StringWriter.java:147)
at java.io.StringWriter.append(StringWriter.java:199)
at java.io.StringWriter.append(StringWriter.java:30)
at com.google.gson.stream.JsonWriter.beforeValue(JsonWriter.java:651)
at com.google.gson.stream.JsonWriter.value(JsonWriter.java:481)
at com.google.gson.internal.bind.TypeAdapters$3.write(TypeAdapters.java:165)
at com.google.gson.internal.bind.TypeAdapters$3.write(TypeAdapters.java:151)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:69)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:125)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:243)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:69)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:97)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:61)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:69)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:125)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:243)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:69)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:97)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.write(CollectionTypeAdapterFactory.java:61)
at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:69)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:125)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:243)
at com.google.gson.Gson.toJson(Gson.java:669)
at com.google.gson.Gson.toJson(Gson.java:648)
at com.google.gson.Gson.toJson(Gson.java:603)
at com.google.gson.Gson.toJson(Gson.java:583)
at appliedlife.pvtltd.SHEROES.preferences.GsonConverter.serialize(GsonConverter.java:24)
at com.f2prateek.rx.preferences2.ConverterAdapter.set(ConverterAdapter.java:25)
at com.f2prateek.rx.preferences2.RealPreference.set(RealPreference.java:72)
at appliedlife.pvtltd.SHEROES.presenters.FeedPresenter$2.onNext(FeedPresenter.java:271)
at appliedlife.pvtltd.SHEROES.presenters.FeedPresenter$2.onNext(FeedPresenter.java:253)
at io.reactivex.observers.SerializedObserver.onNext(SerializedObserver.java:111)
at io.reactivex.internal.operators.observable.ObservableTakeUntil$TakeUntilObserver.onNext(ObservableTakeUntil.java:87)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:200)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:252)
at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:109)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:6102)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1028)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
from rx-preferences.
Failed to allocate a 79288 byte allocation with 46080 free bytes and 44KB until OOM
I doubt this is an issue in rx-preferences or even GSON. You only had 44kb of memory left. Something else in your application is using up this memory.
from rx-preferences.
But I am getting this OutOfMemoryError only GsonConverter.serialize(), this method used for RxSharedPreferences
@singleton
@provides
public Preference provideTokenPref(RxSharedPreferences rxSharedPreferences, Gson gson) {
return rxSharedPreferences.getObject(AppConstants.AUTH_TOKEN, new LoginResponse(), new GsonConverter(gson, LoginResponse.class));
}
from rx-preferences.
Related Issues (20)
- asObservable() method do not emit values previously stored in SharedPreferences HOT 2
- Add MemoryPreference artifact? HOT 5
- Set Error Prone version for deterministic builds.
- transforming to single HOT 2
- Emissions from RxSharedPreferences.keyChanges HOT 2
- apply() is lossy HOT 7
- Expose an api for entirely non-null preferences HOT 5
- Question about deserializing null after migrating to 2.0.0
- Android X support HOT 5
- error: [Dagger/MissingBinding]
- StringAdapter returns null HOT 4
- unit testing with rxPreference
- RxJava3 HOT 1
- Support for EncryptedSharedPreference
- NullPointerException when targeting devices running OS versions Android R or later HOT 6
- update changelog - mention AndroidX please
- Release a new version 2.0.2 HOT 7
- Build failure on master HOT 2
- Fork of f2prateek/rx-preferences HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rx-preferences.