From ec4615b63924f30e5dc732aed3b2de39d2ba9b5f Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Tue, 12 Jun 2018 16:52:42 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=98=20Tweak=20memory=20usage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/ch/dissem/apps/abit/service/Singleton.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/ch/dissem/apps/abit/service/Singleton.kt b/app/src/main/java/ch/dissem/apps/abit/service/Singleton.kt index b311064..e03beec 100644 --- a/app/src/main/java/ch/dissem/apps/abit/service/Singleton.kt +++ b/app/src/main/java/ch/dissem/apps/abit/service/Singleton.kt @@ -32,6 +32,7 @@ import ch.dissem.bitmessage.BitmessageContext import ch.dissem.bitmessage.entity.BitmessageAddress import ch.dissem.bitmessage.entity.payload.Pubkey import ch.dissem.bitmessage.entity.valueobject.Label +import ch.dissem.bitmessage.factory.BufferPool import ch.dissem.bitmessage.networking.nio.NioNetworkHandler import ch.dissem.bitmessage.ports.DefaultLabeler import ch.dissem.bitmessage.utils.ConversationService @@ -101,6 +102,7 @@ object Singleton { fun getBitmessageContext(context: Context): BitmessageContext = init({ bitmessageContext }, { bitmessageContext = it }) { + BufferPool.setLimit(4) BitmessageContext.build { TTL.pubkey = 2 * DAY val ctx = context.applicationContext @@ -117,7 +119,7 @@ object Singleton { labelRepo = AndroidLabelRepository(sqlHelper, ctx) messageRepo = AndroidMessageRepository(sqlHelper) proofOfWorkRepo = AndroidProofOfWorkRepository(sqlHelper).also { powRepo = it } - networkHandler = NioNetworkHandler() + networkHandler = NioNetworkHandler(4) listener = getMessageListener(ctx) labeler = Singleton.labeler preferences.sendPubkeyOnIdentityCreation = false