Skip to content

Reduce Resolver Cache memory usage#106

Merged
supermem613 merged 2 commits intomainfrom
reduce-memory-usage
Jan 12, 2024
Merged

Reduce Resolver Cache memory usage#106
supermem613 merged 2 commits intomainfrom
reduce-memory-usage

Conversation

@supermem613
Copy link
Copy Markdown
Contributor

This is a regression from the PR functionality (#91). We have a cache of graph objects (user and groups) to provide email resolution in query UX. For customers with very large graphs, lo and behold, we tie up a lot of memory.

We are going to mitigate the memory usage with two approaches:

(1) Instead of caching full graph objects (user and group), let's just cache the data we use. This brings down memory consumption by ~60% on a test machine where there are a lot of objects to cache.
(2) We will only load the resolver cache when it is used. If a customer doesn't use PR functionality at all, it would never light up, so we save the bandwidth, CPU, and memory. Compared to 0.1.8, this change yields ~80% memory savings on a machine with lots of graph objects.

Overall, this will make the PR feature fully pay-for-play as you won't pay any CPU, network, or memory costs unless you use it. And even when you use it, we will use a lot less memory (~60% less in my tests).

Also tested with PR queries and observed the on-demand querying happening. All async and not blocking any UI threads as it was previously.

Fixes #100.

Instead of caching full graph objects (user and group), let's just cache the data we use.

This brings down memory consumption by roughly ~60% on a test machine where there are a lot of objects to cache.
Let's change it so we will only load the resolver cache when it is actually used. If a customer doesn't use PR functionality at all, it would never light up, so we save the bandwidth, CPU and memory.

Compared to 0.1.8, this change yields ~80% memory savings on a machine with lots of graph objects.
@supermem613 supermem613 added the bug Something isn't working label Jan 11, 2024
@supermem613 supermem613 enabled auto-merge (squash) January 11, 2024 17:12
@supermem613 supermem613 merged commit 03ede88 into main Jan 12, 2024
@supermem613 supermem613 deleted the reduce-memory-usage branch January 12, 2024 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TeamMate regularly consumes almost 1GB of memory within few seconds of starting

2 participants