Git Product home page Git Product logo

Comments (4)

f2prateek avatar f2prateek commented on July 17, 2024

Do you have a stacktrace?

from rx-preferences.

PraveenSheroes avatar PraveenSheroes commented on July 17, 2024

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.

f2prateek avatar f2prateek commented on July 17, 2024

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.

PraveenSheroes avatar PraveenSheroes commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.