Finding A Memory Leak In ReactJS/NextJS/ApolloClient Web App

enter image description here

So i am having trouble approaching a memory leak in my new web app. Of course it never showed up while developing locally. Every 18 hours, a Kubernetes pod running one web client will run out of memory and restart. I have considered these tools, but am not sure which one is best suited:

The Grinder 

I want to test locally. The plan is to deploy one docker container and then bombard it with requests until it runs out of memory. That should hypothetically work. I have never done this before and am not sure about how to proceed.

Help would be appreciated.

I have a couple of guesses of where the problem is situated (probably ApolloClient in-memory caching...) but i need a way to reliably test it without deploying to master and waiting 18+ hours.

If anyone needs more info, i will gladly provide it.



You can use Jmeter to bombard number of requests but you have to create script (covering all the application journeys) in Jmeter before doing that. Moreover, you should also know your user load and how many hits/per second your pod is getting because you have to use similar settings in Jmeter to replicate memory leak. Apart from that, you would also require profiling tools such as jprofiler on the server end to understand which part of the code is causing memory leakage.