commit 6818d001f24bbc437f3b22ec87dc912bdceafe49
parent 4bf9160502bca815317aac8fe42afc13fef50156
Author: William Casarin <jb55@jb55.com>
Date: Mon, 9 Dec 2024 13:49:35 -0800
nostrdb: mem: reduce default queue size
This was overkill and was using lots of memory
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/nostrdb/src/nostrdb.c b/nostrdb/src/nostrdb.c
@@ -41,8 +41,7 @@
#define MAX_FILTERS 16
// the maximum size of inbox queues
-static const int DEFAULT_QUEUE_SIZE = 1000000;
-
+static const int DEFAULT_QUEUE_SIZE = 32768;
// increase if we need bigger filters
#define NDB_FILTER_PAGES 64
@@ -6654,7 +6653,7 @@ uint64_t ndb_subscribe(struct ndb *ndb, struct ndb_filter *filters, int num_filt
return 0;
// 500k ought to be enough for anyone
- buflen = sizeof(uint64_t) * 65536;
+ buflen = sizeof(uint64_t) * DEFAULT_QUEUE_SIZE;
buf = malloc(buflen);
if (!prot_queue_init(&sub->inbox, buf, buflen, sizeof(uint64_t))) {