Joseph CrawfordJ
Denoβ€’16mo agoβ€’
40 replies
Joseph Crawford

Deno Memory Usage Increases, Does Not Decrease.

Good Morning, I am coming in here because we have several applications which we are using Deno to run them with, they all suffer from the same issue. One such application is a push service which is using Oak for routing and is a simple API which communicates with Redis to authenticate token requests as well as store a list of channels in a redis key so that we know what channels have subscriptions. There are only a few endpoints to subscribe, unsubscribe and to send a push notification into a redis queue for our consumer to process.

We have found that when running this application on our cloud provider that our Docker containers are consuming a lot of memory and eventually hit our scaling limits which cause auto scaling to add another container to the environment and the old one is taken down. The problem we are having is that this is constantly happening. We have noticed that memory usage is increasing but never decreasing. I would assume that memory would increase but that at some point that memory would be freed and the usage would return to the baseline. This is not happening.

I am wondering if there are any Deno tools which could assist us in determining what is using and holding on to that memory. I looked at denosoar but that seems to be for small applications or at-least applications where you do not run them under Docker and do not need to send specific payloads to the endpoints. We also tried to use Deno.memoryUsage and found that our RSS was 477 MB, heap was 13.5 MB, 11.9 MB heap used and 3.6 MB external. I am wondering what could be using so much under rss but not be part of any other metrics.

I have attached a screenshot and as you can see the cliffs are when the memory usage triggers autoscaling, as you can also see from the screen shot is that the memory does not decrease to the baseline until scaling kicks in and the new container is put into rotation and the old container is taken down.

Any suggestions or advice would be appreciated.
Screenshot_2024-09-12_at_9.15.12_AM.png
Was this page helpful?